warp-ctc icon indicating copy to clipboard operation
warp-ctc copied to clipboard

python setup.py install-error cuda_runtime_api.h: No such file or directory

Open sdzbft opened this issue 5 years ago • 9 comments

when i run python setup.py install, a error occured as follows, i don't know how to solve it,,,,,thx a lot for you help~ my envs is py36 pytorch1.0.1

(crnn_torch_py36) futong@server:~/env_conf/warp-ctc/pytorch_binding$ python setup.py install running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'warpctc_pytorch._warp_ctc' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/futong/env_conf/warp-ctc/include -I/home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include -I/home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include/TH -I/home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda:/include -I/home/futong/anaconda3/envs/crnn_torch_py36/include/python3.6m -c src/binding.cpp -o build/temp.linux-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DWARPCTC_ENABLE_GPU -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include/ATen/cuda/CUDAContext.h:5:0, from src/binding.cpp:9: /home/futong/anaconda3/envs/crnn_torch_py36/lib/python3.6/site-packages/torch/lib/include/ATen/cuda/CUDAStream.h:6:30: fatal error: cuda_runtime_api.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1

sdzbft avatar May 10 '19 19:05 sdzbft

Are there someone, who can help us. We have the same problem!

pursu avatar May 31 '19 04:05 pursu

I fixed it by modifying setup.py: include_dirs = [os.path.realpath('../include')] to include_dirs = [os.path.realpath('../include'), '/path/to/cuda/include/']

baudzhou avatar May 31 '19 09:05 baudzhou

I fixed it by modifying setup.py: include_dirs = [os.path.realpath('../include')] to include_dirs = [os.path.realpath('../include'), '/path/to/cuda/include/']

Thanks for your help. But I meet a new problem. Like this: building 'warpctc_pytorch._warp_ctc' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/u/testproject/test_t/warp-ctc/include -I/usr/local/cuda/include/ -I/home/u/anaconda3/envs/testwarp/lib/python3.6/site-packages/torch/lib/include -I/home/u/anaconda3/envs/testwarp/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/u/anaconda3/envs/testwarp/lib/python3.6/site-packages/torch/lib/include/TH -I/home/u/anaconda3/envs/testwarp/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda/include -I/home/u/anaconda3/envs/testwarp/include/python3.6m -c src/binding.cpp -o build/temp.linux-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DWARPCTC_ENABLE_GPU -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ src/binding.cpp:10:33: fatal error: c10/cuda/CUDAGuard.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1

I just have no idea about it. Please, help us.

pursu avatar Jun 01 '19 13:06 pursu

Is this issue caused by cuda version? I use cuda10, and I met the same problem: fatal error: c10/cuda/CUDAGuard.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1

SunlerZRY avatar Aug 10 '19 13:08 SunlerZRY

@SunlerZRY @pursu i meet the problem too,i use cuda9.0,how do you fix it?

liudatutu avatar Aug 12 '19 11:08 liudatutu

@liudatutu I just delete c10/cuda/CUDAGuard.h. After implement this, I don't met problems related to it.

SunlerZRY avatar Aug 13 '19 14:08 SunlerZRY

@aiFTong @liudatutu I have met the same problem. I think it's caused by the wrong CUDA_HOME path. From the shell output, you can find -I:/usr/local/cuda/include, this should be -l/usr/local/cuda/include. I solved this problem by: export CUDA_HOME= /usr/local/cuda

Yellower avatar Sep 10 '19 11:09 Yellower

I modified file "<repo/pytorch_binding/src/binding.cpp>" line 10: from #include <c10/cuda/CUDAGuard.h> to #include "ATen/cuda/CUDAGuard.h"

By the way, if you met up the issue: ModuleNotFoundError: No module named 'warpctc_pytorch._warp_ctc' when import warpctc_pytorch, you can refer to #30

7wdeepin avatar May 07 '20 03:05 7wdeepin

I fixed it by modifying setup.py: include_dirs = [os.path.realpath('../include')] to include_dirs = [os.path.realpath('../include'), '/path/to/cuda/include/']

Worked fine for me. Thanks a lot ! Visual Studio Professional 2019, Visual Studio Build Tools 2019, Python 3.8, Spider 4.1.4, Cuda v10.1 -> I had to setup Visual Studio in English. (French accents 'é' mess up the directories). -> include_dirs = [extensions_dir,'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/include'] => ERROR: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\bin\nvcc NOT FOUND -> Copied the whole folder content C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1 to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA => Installation Succesful

guideligne avatar Nov 25 '20 07:11 guideligne