简体   繁体   English

OSError:CUDA lib64路径无法位于/ usr / lib64中

[英]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 我使用这个: 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): 解决了这个问题,对于那些可能会结束使用这个流行软件的人(对于Cuda~5)使用以下更改:

in ~/computer_vision/py-faster-rcnn/lib/setup.py ~/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. 如果您使用的是Cuda7.5,则可能需要将其保留为lib64,否则可能会出错。

This error may also appear if CUDAHOME is not set. 如果未设置CUDAHOME,也可能出现此错误。 Try: 尝试:

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

For Ubuntu 17.04 对于Ubuntu 17.04

Set CUDAHOME in .bashrc file in /home folder to, 在/ home文件夹中的.bashrc文件中设置CUDAHOME,

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

Then execute source ~/.bashrc 然后执行source ~/.bashrc

Remember to open a new terminal to be able to use the new environment variable. 请记住打开一个新的终端,以便能够使用新的环境变量。

Change the setup.py file from 从中更改setup.py文件

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 . 还需要安装g++5因为nvcc不支持g++6

sudo apt install g++-5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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