tensorflow版本与cuda版本有对应关系。在用anaconda控制tf版本时需要更改对应的cuda版本。
安装cuda 8或10
1、 官网下载.run文件
cuda8 :https://developer.nvidia.com/cuda-downloads
cuda10:https://developer.nvidia.com/cuda-80-ga2-download-archive
2Terminal 中 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 361.62?
(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 /root ]:回车
3、配置环境变量
sudo gedit ~/.bashrc
在文件末尾加入:
export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda-9.0
最后使其生效:
source ~/.bashrc
4.常用命令:查看cuda版本: nvcc -V
5 如何更换cuda版本 https://blog.csdn.net/qq_23996885/article/details/90246210