红联Linux门户
Linux帮助

出现cannot find Toolkit in /usr/local/cuda-8.0的处理

发布时间:2017-05-28 09:54:36来源:linux网站作者:wishchin
对于新版本ubuntukylin17.04安装CUDA时出现:
cannot find Toolkit in /usr/local/cuda-8.0
 
问题
尝试了各种方法,均不妥当。
 
参考
Configuration
Debian GNU/Linux 9 (stretch) 64-bit
NVIDIA GeForce GT 740M
Purpose
I'm tring to install tensorflow with gpu support.
Attempt 1 (runfile for Ubuntu 16.04)
runfile: https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run
$ sudo ./cuda_8.0.44_linux.run --override
Error log (/tmp/cuda_install_6104.log)
Using more to view the EULA.
Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
Verifying archive integrity... All good.
Uncompressing NVIDIA CUDA....................(...)
Can't locate InstallUtils.pm in @INC (you may need to install the InstallUtils module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./install-linux.pl line 6.
BEGIN failed--compilation aborted at ./install-linux.pl line 6.
Verifying archive integrity... All good.
Uncompressing NVIDIA CUDA Samples....................(...)
Can't locate InstallUtils.pm in @INC (you may need to install the InstallUtils module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./install-sdk-linux.pl line 6.
BEGIN failed--compilation aborted at ./install-sdk-linux.pl line 6.
'uninstall_cuda_8.0.pl' -> '/usr/local/cuda-8.0/bin/uninstall_cuda_8.0.pl'
Warning: cannot find Toolkit in /usr/local/cuda-8.0. Use --toolkitpath to specify the toolkit location.
Installing the CUDA Samples in /home/riless ...
===========
= Summary =
===========
Driver:   Not Selected
Toolkit:  Installation Failed
Samples:  Installation Failed
Logfile is /tmp/cuda_install_6104.log
Attempt 2 (apt-get)
$ sudo apt install nvidia-cuda-toolkit
$ ln -sf /usr/lib/nvidia-cuda-toolkit /usr/local/cuda 
$ cd tensorflow
$ sudo ./configure 
...
Please specify the location where CUDA  toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
Invalid path to CUDA  toolkit. /usr/local/cuda/lib64/libcudart.so cannot be found
What I've tried:
$ sudo find / -name "libcudart.so"
/usr/lib/x86_64-linux-gnu/libcudart.so
$ ln -sf /usr/lib/x86_64-linux-gnu/libcudart.so /usr/local/cuda/lib64/libcudart.so
# retried to run configure
$ sudo ./configure
...
ERROR: package contains errors: tensorflow/compiler/tests.
ERROR: error loading package 'tensorflow/compiler/tests': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
File "/home/<user>/Downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 824
_create_cuda_repository(repository_ctx)
File "/home/<user>/Downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 747, in _create_cuda_repository
_symlink_dir(repository_ctx, cuda_toolkit_path ...", ...")
File "/home/<user>/Downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 729, in _symlink_dir
repository_ctx.path(src_dir).readdir()
/usr/lib/nvidia-cuda-toolkit/nvvm (No such file or directory).
 
使用apt-get进行安装
sudo apt install nvidia-cuda-toolkit
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31124.html