I'm on Linux, I set up a fresh conda env and type:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
conda install faiss-gpu cudatoolkit=10.1 -c pytorch
When I do 'import faiss-gpu' I get:
Traceback (most recent call last):
File "/private/home/ofirp/.conda/envs/test_faiss/lib/python3.6/site-packages/faiss/swigfaiss_avx2.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/private/home/ofirp/.conda/envs/test_faiss/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: libcudart.so.10.0: cannot open shared object file: No such file or directory
Thanks!
OS: Linux
Faiss version: faiss-gpu
Faiss compilation options:
Running on:
Interface:
Same error occurs with CUDA 10.2 as well.
Follow up on this. We are also hit by the same problem, especially pytorch starts with cuda 10.1 now.
+1 This would be really useful with pytorch 1.6.
watch
Has anyone tried compiling for GPU?
Instead of installing FAISS by conda, I solved this problem by compile-from-source.
It is a little hassle to install, but it works fine for both cuda 10.1 and 10.2.
mark
There are some already compiled builds for cuda 10.1, 10.2, and 11.0 in the conda-forge channel. To install a specific build, try conda search faiss=<version> --info -c conda-forge and find the no-conflict one with your environment. Then you can install by conda install faiss=<version>=<build_string>, e.g., conda install faiss=1.6.3=py37hddabd6f_3_cuda -c conda-forge.
Most helpful comment
There are some already compiled builds for cuda 10.1, 10.2, and 11.0 in the conda-forge channel. To install a specific build, try
conda search faiss=<version> --info -c conda-forgeand find the no-conflict one with your environment. Then you can install byconda install faiss=<version>=<build_string>, e.g.,conda install faiss=1.6.3=py37hddabd6f_3_cuda -c conda-forge.