Cmake Variables Error When Installing Faiss-Gpu: "Failed to Detect a Default Cuda Architecture"

I’m order to install faiss-gpu, I first needed to install cmake and did it by cloning the cmake repo from and running

./bootstrap && make && make install

Then to install faiss-gpu I cloned the following repo Once cloned I changed directory into that folder and ran the following:

cmake -B build . && make -C -j faiss

But I get multiple errors related to environment variables not set such as:

CMake Error at /usr/local/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:603 (message):
  Failed to detect a default CUDA architecture.
 
 
 
  Compiler output:
 
Call Stack (most recent call first):
  CMakeLists.txt:62 (enable_language)
 
 
-- Configuring incomplete, errors occurred!
 

After doing some research I found this as a possible solution, so I did the following:

cmake . -DCMAKE_CUDA_ARCHITECTURES=52 61 -DTARGET_NAME=tgt

Then the next error is that there is a missing variable: _CMAKE_CUDA_WHOLE_FLAG

Read above as described in detail.

2
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article