Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building FAISS with GPU support fails #667

Closed
cchadowitz opened this issue Nov 14, 2019 · 1 comment
Closed

Building FAISS with GPU support fails #667

cchadowitz opened this issue Nov 14, 2019 · 1 comment

Comments

@cchadowitz
Copy link
Collaborator

cchadowitz commented Nov 14, 2019

It looks like facebookresearch/faiss#943 introduced changes that causes building FAISS with GPU support to fail on my system. I'm running Ubuntu 16.04 with a GTX 1070 (compute capability 6.1), CUDA 10.1.

Upon further investigation, it seems that this is inherently an FAISS issue, and not a Deepdetect issue, but I will still open this to track it, feel free to close if necessary.

Steps to reproduce:

./configure --with-cuda=/usr/local/cuda --with-cuda-arch="-gencode=arch=compute_61,code=sm_61"
make

Relevant output:

g++ -std=c++11 -DFINTEGER=int  -fopenmp -I/usr/local/cuda/include  -I. -fPIC -m64 -Wno-sign-compare -g -O3 -Wall -Wextra -mpopcnt -msse4 -c gpu/utils/MemorySpace.cpp -o gpu/utils/MemorySpace.o
/usr/local/cuda/bin/nvcc -I /usr/local/cuda/targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode=arch=compute_61,code=sm_61 -lineinfo -ccbin g++ -std=c++11 -DFAISS_USE_FLOAT16 -I. -g -O3 -c gpu/GpuIndex.cu -o gpu/GpuIndex.o
/usr/local/cuda/bin/nvcc -I /usr/local/cuda/targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode=arch=compute_61,code=sm_61 -lineinfo -ccbin g++ -std=c++11 -DFAISS_USE_FLOAT16 -I. -g -O3 -c gpu/GpuIndexFlat.cu -o gpu/GpuIndexFlat.o
/usr/local/cuda/bin/nvcc -I /usr/local/cuda/targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode=arch=compute_61,code=sm_61 -lineinfo -ccbin g++ -std=c++11 -DFAISS_USE_FLOAT16 -I. -g -O3 -c gpu/GpuIndexBinaryFlat.cu -o gpu/GpuIndexBinaryFlat.o
/usr/local/cuda/bin/nvcc -I /usr/local/cuda/targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode=arch=compute_61,code=sm_61 -lineinfo -ccbin g++ -std=c++11 -DFAISS_USE_FLOAT16 -I. -g -O3 -c gpu/GpuIndexIVFScalarQuantizer.cu -o gpu/GpuIndexIVFScalarQuantizer.o
./faiss/gpu/impl/GpuScalarQuantizer.cuh(162): error: function "faiss::gpu::Convert<half, float>::operator()" cannot be called with the given argument list
            argument types are: (unsigned int)
            object type is: faiss::gpu::Convert<half, float>

./faiss/gpu/impl/GpuScalarQuantizer.cuh(163): error: class "__half2" has no member "y"

./faiss/gpu/impl/GpuScalarQuantizer.cuh(180): error: no suitable conversion function from "half" to "unsigned int" exists

./faiss/gpu/impl/GpuScalarQuantizer.cuh(181): error: class "__half2" has no member "y"

4 errors detected in the compilation of "/tmp/tmpxft_00002a9a_00000000-7_GpuIndexIVFScalarQuantizer.cpp1.ii".
Makefile:45: recipe for target 'gpu/GpuIndexIVFScalarQuantizer.o' failed
make: *** [gpu/GpuIndexIVFScalarQuantizer.o] Error 2

When using FAISS v1.6.0+ (including the master branch, which is what Deepdetect is forked from), I get the error above. When I use FAISS v1.5.1 or v1.5.3, it builds without an error.

I will update this as I discover more, but it may be worth pinning the FAISS version used in Deepdetect to a particular release version.

@cchadowitz
Copy link
Collaborator Author

After much messing around, I realized that I was actually using the CUDA 8.0 toolkit, although my driver supported CUDA 10.1. Also, I had not updated my cmake to 3.14.0, though I'm not sure that made any difference here.

I'm now able to build it with an updated CUDA 10.1 toolkit, so I'm going to go ahead and close this unless something comes up again. Sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant