我想安装 CUDA 8.0,但是使用 Nvidia 提供的*.deb
文件而不是*.run
安装程序时得到的是 CUDA 7.5。
我按照 Nvidia 网站上的说明进行安装:
https://developer.nvidia.com/cuda-80-ga2-download-archive
我安装了:
./cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb
网站上列出的说明:
`sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64.deb`
`sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
`sudo apt-get update`
`sudo apt-get install cuda`
我表演了“验证 CUDA 安装”从这个答案开始:https://askubuntu.com/a/799185
运行结果nvcc --version
:
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
我第二次运行安装程序步骤时的结果:
$ sudo apt install cuda
[sudo] password for USER:
Reading package lists... Done
Building dependency tree
Reading state information... Done
cuda is already the newest version (8.0.61-1).
The following packages were automatically installed and are no longer required:
linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic linux-image-4.13.0-36-generic
linux-image-extra-4.13.0-36-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
肯定有些地方不正确,因为当我使用*.run
同一页面上的安装程序版本时,它会给我以下nvcc
输出:
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
两台机器都安装了相同的 Nvidia 驱动程序:
$ nvidia-smi
Wed Jun 27 08:20:03 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130 Driver Version: 384.130 |
|-------------------------------+----------------------+----------------------+
但是 GPU 有所不同,但这没关系,因为出现问题的机器配备了较新的显卡。Nvidia GeForce GTX 1050 Ti与 960M 相比
为了避免与 Ubuntu 16.04 冲突和寻找兼容驱动程序的麻烦,我只使用了附加驱动程序选项卡在software-properties-gtk
答案1
sudo apt install nvidia-cuda-toolkit
无需登录 GUI 并安装 cuda 后重新启动系统。