0

I am attempting to install chainer-cude-deps. When I try to install (sudo pip install chainer-cuda-deps), I get the following error:

    In file included from src/cpp/cuda.cpp:1:0:
    src/cpp/cuda.hpp:14:18: fatal error: cuda.h: No such file or directory
     #include <cuda.h>
                      ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-sLLkNT/pycuda/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-OAHHif-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-sLLkNT/pycuda

This is following the following previous steps:

sudo pip install chainer
sudo dpkg -i cuda-repo-ubuntu1410-7-0-local_7.0-28_amd64.deb

What should I do to try to install chainer-cuda-deps?

1

It is a problem of pycuda. setup.py of pycuda checks nvcc command and guesses a root directory of CUDA.

https://github.com/inducer/pycuda/blob/master/setup.py#L30

..., and then it sets include directory of CUDA.

https://github.com/inducer/pycuda/blob/master/setup.py#L93

All you need is set path correctly before pip.

PATH=/usr/local/cuda-7.0/bin:$PATH
pip install chainer-cuda-deps

Please try it!

0

I was also plagued by the same error. Perhaps you also pycuda is not installed properly. instead pip, please try to install the pycuda from the source.

If pycuda can not be installed from the source, there is a risk such as the path of CUDA itself is funny.

Eventually Ubuntu14.04, we have been successful in the construction of pycuda and chainer environment on the configuration CUDA7.0.

Put incidentally to write my environment

On the assumption #CUDA is that it is installed properly

#CUDA Relationship of PATH (by rewriting your environment)
CUDA_ROOT=/usr/local/cuda-7.0

PATH=$PATH:/usr/local/cuda-7.0/bin

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib

CPATH=$CPATH:/usr/local/cuda-7.0/include

CUDA_INC_DIR=/usr/local/cuda-7.0/bin:$CUDA_INC_DIR

#Installing from source of #pycuda
git clone --recursive http://git.tiker.net/trees/pycuda.git
cd pycuda
python configure.py
sudo python setup.py install
sudo make install

Good luck.

-1

Put incidentally to write my environment

On the assumption #CUDA is that it is installed properly

CUDA Relationship of PATH (by rewriting your environment)

CUDA_ROOT=/usr/local/cuda-7.0

PATH=$PATH:/usr/local/cuda-7.0/bin

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib

CPATH=$CPATH:/usr/local/cuda-7.0/include

CUDA_INC_DIR=/usr/local/cuda-7.0/bin:$CUDA_INC_DIR

Installing from source of #pycuda

git clone --recursive http://git.tiker.net/trees/pycuda.git cd pycuda python configure.py sudo python setup.py install sudo make install

  • Downvote: This is no forum, you should edit your previous answer not add another one. Please mind that the order of the answers is not fixed and this could get very confusing. – Javier Rivera Jul 2 '15 at 6:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.