facebookresearch / faiss

A library for efficient similarity search and clustering of dense vectors.

Home Page:https://faiss.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUDA12 Compile failed, cublas.h and cublas_v2.h conflict

matrixji opened this issue · comments

commented

Summary

As cuda12 "Disallow including cublas.h and cublas_v2.h in the same translation unit."

Platform

Ubuntu 22.04 + Cuda 12.0 x86_64

Faiss version: master 38bf321

Installed from: Compile from source

Faiss compilation options: "cmake -DFAISS_ENABLE_C_API=YES .."

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python

Actually, it should be an error from c_api

Reproduction instructions

make, will leads below error:

[ 69%] Building CXX object c_api/CMakeFiles/faiss_c.dir/gpu/DeviceUtils_c.cpp.o
In file included from /home/jibin/working/faiss/faiss/gpu/utils/DeviceUtils.h:10,
                 from /home/jibin/working/faiss/c_api/gpu/DeviceUtils_c.cpp:12:
/usr/local/cuda/include/cublas_v2.h:59:2: error: #error "It is an error to include both cublas.h and cublas_v2.h"
   59 | #error "It is an error to include both cublas.h and cublas_v2.h"
      |  ^~~~~

And changing cublas.h => cublas_v2.h in c_api/gpu/DeviceUtils_c.h could resolve this issue.

I'll provide PR for it.