@@ -276,6 +276,21 @@ jobs:
276276 fetch-tags : true
277277 - name : Build and Package (conda)
278278 uses : ./.github/actions/build_conda
279+ linux-x86_64-GPU-conda :
280+ name : Linux x86_64 GPU (conda, CUDA 12.6)
281+ runs-on : 4-core-ubuntu-gpu-t4
282+ env :
283+ CUDA_ARCHS : " 70-real;72-real;75-real;80;86-real"
284+ steps :
285+ - name : Checkout
286+ uses : actions/checkout@v4
287+ with :
288+ fetch-depth : 0
289+ fetch-tags : true
290+ - name : Build and Package (conda)
291+ uses : ./.github/actions/build_conda
292+ with :
293+ cuda : " 12.6"
279294 linux-x86_64-svs :
280295 name : Linux x86_64 w/ SVS (cmake)
281296 needs : linux-x86_64-cmake
@@ -287,6 +302,109 @@ jobs:
287302 uses : ./.github/actions/build_cmake
288303 with :
289304 svs : ON
305+ linux-riscv64-DD-cmake :
306+ name : Linux riscv64 Dynamic Dispatch cross-compile (cmake)
307+ needs : linux-x86_64-cmake
308+ runs-on : ubuntu-latest
309+ steps :
310+ - name : Checkout
311+ uses : actions/checkout@v4
312+
313+ - name : Set up riscv64 cross-compilation environment
314+ run : |
315+ sudo dpkg --add-architecture riscv64
316+
317+ # Restrict existing apt sources to amd64/i386 so that apt does not
318+ # try (and fail) to fetch riscv64 packages from the main Ubuntu
319+ # mirror, which does not carry riscv64.
320+ if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
321+ # Ubuntu 24.04+ deb822 format: insert Architectures field.
322+ sudo sed -i '/^Types: deb$/a Architectures: amd64 i386' \
323+ /etc/apt/sources.list.d/ubuntu.sources
324+ fi
325+ if grep -q '^deb http' /etc/apt/sources.list 2>/dev/null; then
326+ # Ubuntu 22.04 traditional .list format.
327+ sudo sed -i 's|^deb http|deb [arch=amd64,i386] http|g' \
328+ /etc/apt/sources.list
329+ fi
330+
331+ # Add Ubuntu Ports as the riscv64 package source.
332+ CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")
333+ echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME} main restricted universe" \
334+ | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
335+ echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME}-updates main restricted universe" \
336+ | sudo tee -a /etc/apt/sources.list.d/riscv64-ports.list
337+
338+ sudo apt-get update -qq
339+ sudo apt-get install -y -qq \
340+ cmake \
341+ gcc-riscv64-linux-gnu \
342+ g++-riscv64-linux-gnu \
343+ libopenblas-dev:riscv64 \
344+ libgomp1:riscv64 \
345+ qemu-user-static
346+
347+ # Bridge Ubuntu's multiarch library directory into the sysroot so
348+ # that CMake's find_library() (ONLY mode, root=/usr/riscv64-linux-gnu)
349+ # can reach packages installed as :riscv64.
350+ # CMake searches ${root}/usr/lib/<multiarch-tuple>/ thanks to the
351+ # compiler's -print-multiarch output (riscv64-linux-gnu).
352+ sudo mkdir -p /usr/riscv64-linux-gnu/usr/lib
353+ sudo ln -sfn /usr/lib/riscv64-linux-gnu \
354+ /usr/riscv64-linux-gnu/usr/lib/riscv64-linux-gnu
355+
356+ - name : Setup ccache
357+ uses : hendrikmuhs/ccache-action@v1
358+ with :
359+ key : linux-riscv64-dd
360+ max-size : 2G
361+ update-package-index : true
362+
363+ - name : Configure (cmake)
364+ run : |
365+ cmake -B build \
366+ -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/riscv64-linux-gnu.cmake \
367+ -DBUILD_TESTING=ON \
368+ -DBUILD_SHARED_LIBS=ON \
369+ -DFAISS_ENABLE_GPU=OFF \
370+ -DFAISS_OPT_LEVEL=dd \
371+ -DFAISS_ENABLE_PYTHON=OFF \
372+ -DFAISS_ENABLE_C_API=OFF \
373+ -DBLA_VENDOR=OpenBLAS \
374+ -DCMAKE_BUILD_TYPE=Release \
375+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
376+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
377+ -DCMAKE_BUILD_RPATH=/usr/lib/riscv64-linux-gnu \
378+ .
379+
380+ - name : Build faiss_test (includes test_factory_tools)
381+ run : cmake --build build --target faiss_test -j$(nproc)
382+
383+ - name : Verify binary with ldd (via qemu)
384+ run : |
385+ file build/tests/faiss_test
386+ file build/tests/faiss_test | grep -q "RISC-V" || \
387+ { echo "ERROR: not a RISC-V binary"; exit 1; }
388+
389+ # Expose riscv64 libs inside the qemu sysroot so the riscv64 ld.so
390+ # launched by qemu can resolve NEEDED entries.
391+ sudo mkdir -p /usr/riscv64-linux-gnu/usr/lib
392+ sudo ln -sfn /usr/lib/riscv64-linux-gnu \
393+ /usr/riscv64-linux-gnu/usr/lib/riscv64-linux-gnu
394+
395+ # Invoke the riscv64 dynamic linker under qemu with --list, which
396+ # is exactly what ldd does on native hardware.
397+ RISCV64_LD=$(find /usr/riscv64-linux-gnu/lib \
398+ -name "ld-linux-riscv64-*.so.1" | head -1)
399+ qemu-riscv64-static -L /usr/riscv64-linux-gnu \
400+ "$RISCV64_LD" --list build/tests/faiss_test
401+
402+ - name : Run test_simd_levels (via QEMU)
403+ run : |
404+ qemu-riscv64-static -L /usr/riscv64-linux-gnu \
405+ build/tests/faiss_test \
406+ --gtest_filter="SIMDConfig.*:SIMDLevel.*:CompileOptions.*"
407+
290408 index-io-backward-compatibility :
291409 needs : linux-x86_64-cmake
292410 name : Index serialization backward compatibility
0 commit comments