Skip to content

Commit ce058e7

Browse files
Ramil Bakhshyievfacebook-github-bot
authored andcommitted
Workaround for CUDA 11.4.4 build in Conda on Ubuntu 22 / v6 kernel
Summary: When building with CUDA 11.4.4, CMake does not properly include files under Conda environment. This workaround flattens the include sub-directories in to the include root. It will unblock us for now while we are looking for a fix through CMakeLists files or figure out if it's a CMake bug and it gets fixed. Differential Revision: D57545169
1 parent 5e452ed commit ce058e7

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

conda/faiss-gpu/build-lib.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
set -e
88

9+
# Workaround for CUDA 11.4.4 builds. Moves all necessary headers to include root.
10+
if [[ -n "$FAISS_FLATTEN_CONDA_INCLUDES" && "$FAISS_FLATTEN_CONDA_INCLUDES" == "1" ]]; then
11+
cp -r -n $CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/* $CONDA_PREFIX/include/
12+
cp -r -n $CONDA_PREFIX/x86_64-conda-linux-gnu/include/c++/11.2.0/* $CONDA_PREFIX/include/
13+
cp -r -n $CONDA_PREFIX/x86_64-conda-linux-gnu/include/c++/11.2.0/x86_64-conda-linux-gnu/* $CONDA_PREFIX/include/
14+
fi
915

1016
# Build libfaiss.so/libfaiss_avx2.so/libfaiss_avx512.so
1117
cmake -B _build \

conda/faiss-gpu/meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ outputs:
4343
- {{ pin_compatible('libfaiss', exact=True) }}
4444
script_env:
4545
- CUDA_ARCHS
46+
{% if cudatoolkit == '11.4.4' %}
47+
- FAISS_FLATTEN_CONDA_INCLUDES=1
48+
{% endif %}
4649
requirements:
4750
build:
4851
- {{ compiler('cxx') }}

0 commit comments

Comments
 (0)