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

fatal error: cuda/include/cuda.h: No such file or directory #9

Closed
nguyeho7 opened this issue Apr 13, 2018 · 9 comments
Closed

fatal error: cuda/include/cuda.h: No such file or directory #9

nguyeho7 opened this issue Apr 13, 2018 · 9 comments

Comments

@nguyeho7
Copy link

Hello,
I'm running this in a docker container with cuda 9.0 and tensorflow 1.5.0 installed from pip3.
When I run make.sh it get's stuck while compiling psroi_pooling_op_gpu.cu.cc.
The exact error message is as follows:

In file included from psalign_pooling_op_gpu.cu.cc:7:0:
/usr/local/lib/python3.5/dist-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:24:31: fatal error: cuda/include/cuda.h: No such file or directory

Do I have to compile tensorflow from source?

@zengarden
Copy link
Owner

@nguyeho7 Try follows:

 24 #include "cuda.h"

@nguyeho7
Copy link
Author

Thank you, editing cuda/include/cuda.h to "cuda.h" in two .h files worked!

@smoosbau
Copy link

Worked for me as well.
Thanks for your support!
Modified cuda_launch_config.h and cuda_device_functions.h

@liuhengli
Copy link

After modify #include "cuda.h"
Appear fatal error: cuda/cuda_config.h: No such file or directory

@liuhengli
Copy link

@nguyeho7 @Mampfi93

@smoosbau
Copy link

smoosbau commented Jun 25, 2018

@liuhengli as I didn't get this error I can just refere to the FAQ. There's a solution given for your problem.

fatal error: cuda/cuda_config.h: No such file or directory
First, find where is cuda_config.h.
e.g.
find /usr/local/lib/ | grep cuda_config.h
then export your cpath, like:
export CPATH=$CPATH:/usr/local/lib/python3.5/dist-packages/external/local_config_cuda/cuda/

@liuhengli
Copy link

@Mampfi93 thanks, you are right. it worked.

@vedrusss
Copy link

vedrusss commented Oct 4, 2018

Just to resume all solutions above.
I had the issue + one more which looked like
1 error detected in the compilation of "/tmp/tmpxft_00002821_00000000-7_roi_pooling_op_gpu.cu.cpp1.ii".
g++: error: roi_pooling_op.cu.o: No such file or directory

The solution that helped me:

  1. Re-install tensorflow-gpu as root. I had it installed into /home/myuser previously. If you have it the same just do
    pip3 uninstall tensorflow-gpu
    sudo pip3 install tensorflow-gpu==1.5.0
  2. Use solution proposed by @zengarden above. To get known within which two files you must correct those '#include' you may run first ./make.sh and take paths from obtained errors.
  3. Instead of correcting path to cuda_config.h (the 3rd error) use solution provided by @smoosbau above (but it works only if tensorflow-gpu installed under root - see where is xception like network code which is written in original paper? #1).

After used that steps I was finally able to build the project.

@karansomaiah
Copy link

I also faced a similar problem regarding cuda_fp16.h file.
I changed 'cuda/include/cuda_fp16.h' to 'cuda_fp16.h' in the cuda_kernel_helper.h file and resolved the issue.

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

6 participants