The Gardener
The Gardener

Reputation: 37

How can I install faiss-gpu?

I ran into this problem when trying to install faiss-gpu

pip install faiss-gpu

This is the error

ERROR: Could not find a version that satisfies the requirement faiss-gpu (from versions: none)
ERROR: No matching distribution found for faiss-gpu

My GPU is NVIDIA RTX 3050Ti

+---------------------------------------------------------------------------------------+
|                                   Driver Version: 537.13       CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3050 ...  WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P0              13W /  60W |      0MiB /  4096MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

I had unistalled the faiss-cpu before I installed the faiss-gpu. Maybe my CUDA's version is not compatible with faiss-gpu? I try to find some documents but it doesn't really help. Thank you.

Upvotes: 2

Views: 17949

Answers (3)

install mini conda conda create your environment

conda install pip3 pip3 install faiss-cpu

Upvotes: -2

Mirio Togata
Mirio Togata

Reputation: 11

Same problem with me. I'm on ubuntu 22.04 (Jammy) with X86_64 (AMD) architech. I'm using python3.10. I can't both pip install faiss-gpu and faiss-gpu

In my case, I go with building from source and don't want to risk messing with cuda so I decide to go with "disable GPU option".

First clone the faiss repo, in the faiss directory, run cmake -B build . -DFAISS_ENABLE_GPU=OFF
and it required to install more packages:

sudo apt update
sudo apt install libblas-dev liblapack-dev intel-mkl swig

Then in the same fiass directory:

make -C build -j swigfaiss
cd build/faiss/python && python setup.py install

test it by python -c "import faiss;print(faiss.__version__)"

Then you should get the faiss version.

It seems to lack off some libraries. After I finish all these steps, I can install it with pip install faiss-cpu.

Upvotes: 1

Warbler
Warbler

Reputation: 1

You are correct that your CUDA version is not compatible. According to their install readme, faiss-gpu is available for CUDA 11.4 and 12.1.

Upvotes: 0

Related Questions