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

GPU compilation fails: Tensor.cuh(362): type name is not allowed #751

Closed
Steffen911 opened this issue Mar 26, 2019 · 7 comments
Closed

GPU compilation fails: Tensor.cuh(362): type name is not allowed #751

Steffen911 opened this issue Mar 26, 2019 · 7 comments
Assignees

Comments

@Steffen911
Copy link
Contributor

Summary

I follow the Install.md instructions from step 1 to step 3. General compilation and Python setup worked fine, but the GPU compilation fails with:

$ make
/usr/local/cuda/bin/nvcc -I /usr/local/cuda/targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode arch=compute_35,code="compute_35" -gencode arch=compute_52,code="compute_52" -lineinfo -ccbin g++ -std=c++11 -DFAISS_USE_FLOAT16 -g -O3 -c impl/BinaryDistance.cu -o impl/BinaryDistance.o
impl/../utils/Tensor.cuh(362): error: type name is not allowed

impl/../utils/Tensor.cuh(362): error: expected an expression

2 errors detected in the compilation of "/tmp/tmpxft_000010e7_00000000-4_BinaryDistance.cpp4.ii".
make: *** [Makefile:71: impl/BinaryDistance.o] Error 2

The same error occurs multiple times if I follow the recommendation to use multiple threads during make.

Platform

OS: Fedora 29

Faiss version: a9959bf

@mdouze mdouze added the GPU label Mar 27, 2019
@mdouze
Copy link
Contributor

mdouze commented Mar 27, 2019

Which versions of cuda and g++ are you using ?

@mdouze mdouze added the install label Mar 27, 2019
@Steffen911
Copy link
Contributor Author

Steffen911 commented Mar 27, 2019

g++:

$ g++ --version
g++ (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)

cuda:

$ /usr/local/cuda/bin/nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105

I'm using a Nvidia GeForce GTX 970 which supports compute capability 5.2.

@rafaelms101
Copy link

This error happened to me as well, and I fixed it by adding the "template" keyword after arg on the faulty line.

return arg.template canUseIndexType() &&
canUseIndexType(args...);

@mdouze
Copy link
Contributor

mdouze commented Apr 4, 2019

@beauby can we repro this with the compilers used for Travis?
@RedMajor, @Steffen911 would you mind submitting a PR with the suggested change so that we can check if it breaks something else?

@beauby
Copy link
Contributor

beauby commented Apr 4, 2019

@mdouze We won't be able to reproduce this on TravisCI, as they still do not offer GPUs AFAIK, but I'll try to reproduce it locally.

@beauby beauby self-assigned this Apr 4, 2019
@Steffen911
Copy link
Contributor Author

@mdouze I can confirm that the fix by @RedMajor fixes the issue on my side. I will prepare a PR with the change.

beauby pushed a commit that referenced this issue Apr 8, 2019
The GPU compilation fails with g++ 8.3.1 and cuda 10.1
With this proposed fix the compilation works locally

Contributes to #751
@beauby beauby closed this as completed Apr 8, 2019
@jaggzh
Copy link

jaggzh commented Jun 28, 2019

[Solved] Another method.
I got mine to compile by adding --ccbin=$(which g++-6) to nvcc's commandline.
Background:
I'm using cuda-9.1 and nvcc, to compile a software called SiftGPU.
It also gives the error. This was AFTER I disabled the gcc 6 version test in the include files, which some others have also done, but I guess they didn't get this error from defeating that apparently-honest test. :)

CaucherWang pushed a commit to CaucherWang/faiss-learned-termination that referenced this issue Sep 16, 2022
The GPU compilation fails with g++ 8.3.1 and cuda 10.1
With this proposed fix the compilation works locally

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

No branches or pull requests

5 participants