简体   繁体   中英

OSError: The CUDA lib64 path could not be located in /usr/lib64

How can I fix this?

(cv) jalal@klein:~/computer_vision/py-faster-rcnn/lib$ make
python setup.py build_ext --inplace
Traceback (most recent call last):
  File "setup.py", line 58, in <module>
    CUDA = locate_cuda()
  File "setup.py", line 55, in locate_cuda
    raise EnvironmentError('The CUDA %s path could not be located in %s' % (k, v))
OSError: The CUDA lib64 path could not be located in /usr/lib64
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

I am using this: https://github.com/rbgirshick/py-faster-rcnn

Solved this problem using the following change for those who might end of using this popular software (for Cuda ~5):

in ~/computer_vision/py-faster-rcnn/lib/setup.py

change:

cudaconfig = {'home':home, 'nvcc':nvcc,
              'include': pjoin(home, 'include'),
              'lib64': pjoin(home, 'lib64')}

to:

cudaconfig = {'home':home, 'nvcc':nvcc,
              'include': pjoin(home, 'include'),
              'lib64': pjoin(home, 'lib')}

If you are using Cuda7.5 you might need to leave it as lib64 or you might get an error.

This error may also appear if CUDAHOME is not set. Try:

$ export CUDAHOME=/usr/local/cuda-8.0

For Ubuntu 17.04

Set CUDAHOME in .bashrc file in /home folder to,

export CUDAHOME=/usr/lib/nvidia-cuda-toolkit/

Then execute source ~/.bashrc

Remember to open a new terminal to be able to use the new environment variable.

Change the setup.py file from

cudaconfig = {'home':home, 'nvcc':nvcc,
                  'include': pjoin(home, 'include'),
                  'lib64': pjoin(home, 'lib64')}

To

cudaconfig = {'home':home, 'nvcc':nvcc,
               'include': '/usr/include',
               'lib64': '/usr/lib/x86_64-linux-gnu'}

Also needed to install g++5 because nvcc doesn't support g++6 .

sudo apt install g++-5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM