如何在 Ubuntu 14.04 上安装 CUDA-6.5?

ssi*_*ral 6 nvidia cuda 14.04

我正在使用 CUDA5.5,但是我想使用 nvidia 提供的主存储库安装 CUDA6.5。

sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb 
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

但是当我尝试安装 cuda 时,出现以下错误。

sudo apt-get install cuda

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 cuda : Depends: cuda-6-5 (= 6.5-14) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

我将不胜感激任何帮助。

小智 7

与我相同的错误消息,但上述答案对我的情况(Ubuntu 14.10)都没有帮助。因此,首先剖析错误信息。它说:

The following packages have unmet dependencies:
cuda : Depends: cuda-6-5 (= 6.5-14) but it is not going to be installed.
Run Code Online (Sandbox Code Playgroud)

所以cuda有一个cuda-6-5无法安装的依赖项。为什么?让我们检查一下: sudo apt-get install cuda-6-5为我生成了与原始消息类似的消息,例如:

The following packages have unmet dependencies:
cuda-6-5 : Depends: libcudart6.0 (=....) but it is not going to be installed.
Run Code Online (Sandbox Code Playgroud)

libcudart6.0问题也是如此。让我们来看看为什么:sudo apt-get install libcudart6.0结果是:

The following packages have unmet dependencies:
libcudart6.0 : Depends: nvidia-340 (=....) but it is not going to be installed.
Run Code Online (Sandbox Code Playgroud)

所以这就是问题所在:安装的 NVIDIA 驱动程序(以及存储库中可用的驱动程序)不够新。添加xorg-edgersPPA 有助于:

sudo add-apt-repository ppa:xorg-edgers/ppa 
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

运行原始文件sudo apt-get install cuda现在有效。

(如果*.run从 NVIDIA 开发者网站运行该文件,这可能不是问题。)


kar*_*rel 4

从终端运行:

sudo apt-get remove nvidia-cuda-*  # remove old nvidia-cuda packages
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb 
sudo apt-get update
sudo apt-get install cuda
Run Code Online (Sandbox Code Playgroud)

安装CUDA工具包和驱动程序后必须执行一些操作才能完全使用它们。执行安装后操作


Ubuntu 16.04 及更高版本

打开终端并输入;

sudo apt-get remove nvidia-cuda-*  # remove old nvidia-cuda packages
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb 
sudo apt-get update
sudo apt-get install cuda
Run Code Online (Sandbox Code Playgroud)

参考:适用于 Linux v6.5 的 NVIDIA CUDA 入门指南