1. 安装cuda8.0
cuda官网 点击Download下载,然后在下载文件所在的目录下终端输入:
sudo sh cuda_8.0.61_375.26_linux.run
弹出说明书,一直按回车就行。然后:
Do you accept the previously read EULA?
accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(y)es/(n)o/(q)uit: n
Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y
Enter Toolkit Location
[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location
[ default is /home/x ]:
Error: unsupported compiler: 7.5.0. Use --override to override this check.
Error: cannot find Toolkit in /usr/local/cuda-8.0
===========
= Summary =
===========
Driver: Not Selected
Toolkit: Installation Failed. Using unsupported Compiler.
Samples: Cannot find Toolkit in /usr/local/cuda-8.0
Logfile is /tmp/cuda_install_5227.log
trick原因:gcc, g++编译版本过高,cuda8.0不支持这么高版本的编译器。
CUDA8.0版本与Ubuntu 版本,以及GCC版本对应关系:
所以先得安装gcc5:
- 管理员权限打开sources.list
sudo gedit /etc/apt/sources.list
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5 --slave /usr/bin/gcov gcov /usr/bin/gcov-5
|