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

cc1plus: fatal error: cuda_runtime.h: No such file or directory compilation terminated #107

Closed
hellocasper opened this issue Mar 29, 2018 · 1 comment

Comments

@hellocasper
Copy link

1.OS and lib:
Ubuntu 16.04
python 2.7
newest version anaconda
gcc/g++ 5.4
cuda 9.1
2. pytorch is successfully installed(newest version)
image

  1. make.sh is changed and shown as below:
    image

  2. The cuda 9.1 path and lib are exported to the env variables:
    image

  3. Issue description:
    During Compilation, $ sh make.sh

skipping 'model/utils/bbox.c' Cython extension (up-to-date)
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
Compiling nms kernels by nvcc...
cc1plus: fatal error: cuda_runtime.h: No such file or directory
compilation terminated.
Including CUDA code.
/home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms
['/home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmp6Q3gYS/_nms.c
setting the current directory to '/tmp/tmp6Q3gYS'
running build_ext
building '_nms' extension
creating home
creating home/pengguohao
creating home/pengguohao/CV
creating home/pengguohao/CV/fasterrcnn_pytorch
creating home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch
creating home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib
creating home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model
creating home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms
creating home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src
gcc -pthread -B /home/pengguohao/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/pengguohao/anaconda2/include/python2.7 -c _nms.c -o ./_nms.o
gcc -pthread -B /home/pengguohao/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/pengguohao/anaconda2/include/python2.7 -c /home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.c -o ./home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o
gcc -pthread -shared -B /home/pengguohao/anaconda2/compiler_compat -L/home/pengguohao/anaconda2/lib -Wl,-rpath=/home/pengguohao/anaconda2/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_nms.o ./home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o /home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o -L/home/pengguohao/anaconda2/lib -lpython2.7 -o ./_nms.so
gcc: error: /home/pengguohao/CV/fasterrcnn_pytorch/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o: No such file or directory
Traceback (most recent call last):
File "build.py", line 37, in
ffi.build()
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/init.py", line 167, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/torch/utils/ffi/init.py", line 103, in _build_extension
ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/cffi/api.py", line 690, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/cffi/recompiler.py", line 1515, in recompile
compiler_verbose, debug)
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/pengguohao/anaconda2/lib/python2.7/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1

Does anyone have the same issue and any solution plz

@jwyang
Copy link
Owner

jwyang commented Mar 29, 2018

@hellocasper it seems like your cuda is not properly installed. You might want to check that. you can refer to this issue

@jwyang jwyang closed this as completed Mar 30, 2018
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

2 participants