红联Linux门户
Linux帮助

ubuntu 14.04下cuda7.5升级到cuda8.0

发布时间:2016-10-21 10:34:08来源:linux网站作者:Yanncywang
OS:ubuntu 14.04
GPU:GTX 960
 
之前ubuntu已经安装了cuda7.5,本次通过deb升级到cuda8.0,参考了nvidia的英文安装指导,本人是第一次写文章,只是把自己操作的步骤写下来,有些地方可能有问题,请及时指正,谢谢!
 
升级之前的准备工作
uname -m && cat /etc/*release   # get ubuntu version
uname -r                                          # get ubuntu kernal version
gcc --version                                   # get gcc version
lspci | grep -i nvidia                        # check nvidia GPU information
cat /proc/driver/nvidia/version       # check nvidia GPU driver version
 
开始升级cuda8.0
download 7fa2af80.pub file fromhttp://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
cat 7fa2af80.pub | apt-key add -
download cuda-repo-ubuntu1404_8.0.44-1_amd64.deb fromhttp://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
ms5sum cuda-repo-ubuntu1404_8.0.44-1_amd64.deb    #check download file if available
sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
sudo vi ~/.bashrc       # add PATh and LD_LIBRARY_PATH at the end
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
Source ~/.bashrc
sudo reboot
dpkg -l | grep nvidia    # view all nvidia driver
nvidia-smi                      #check GPU memory information     
cd  /usr/local/cuda-8.0/samples
make                               # compile cuda-8.0 sample files
cd bin/x86_64/linux/release/    # run sample file
./deviceQuery
./bandwidthTest
 
我在安装完cuda8.0后没有重启ubuntu,运行sample的时候出现错误,could not insert 'nvidia_361_uvm':Invalid argument,检查nvidia driver version还是352.79,没有升级到361.93,而且运行nvidia-smi出现Failed to initialize NVML: Driver/library version mismatch,尝试重新安装361驱动,并sudo apt-get upgrade,然后重启ubuntu后,发现驱动升级到361.93了,运行nvidia-smi也显示正确GPU信息了。重新make sample file,在release目录下运行sample文件deviceQuery运行正常,返回正确值,passed。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25249.html