有没有人在 Ubuntu 14.04.3 LTS x86_64 上成功安装 CUDA 7.5?

Bru*_* Yo 12 nvidia cuda 14.04

我的工作站有两个 GPU(Quadro K5200 和 Quadro K2200),安装了最新的 NVIDIA 驱动程序(版本:352.41)。cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.debCUDA 7.5 Downloads 下载文件后,我尝试安装它,但结果如下:

root@P700-Bruce:/home/bruce/Downloads# 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-7-5 (= 7.5-18) but it is not going to be installed
 unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                        Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Run Code Online (Sandbox Code Playgroud)

我已经尝试过解决方案:

  1. sudo apt-get remove nvidia-cuda-* # 删除旧的 nvidia-cuda 软件包
  2. 安装未满足的依赖项:

    root@P700-Bruce:/home/bruce/Downloads# apt-get install cuda-7-5
    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-7-5 : Depends: cuda-toolkit-7-5 (= 7.5-18) but it is not going to be installed
                Depends: cuda-runtime-7-5 (= 7.5-18) but it is not going to be installed
     unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                            Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
    
    root@P700-Bruce:/home/bruce/Downloads# apt-get install cuda-toolkit-7-5
    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-toolkit-7-5 : Depends: cuda-core-7-5 (= 7.5-18) but it is not going to be installed
                        Depends: cuda-command-line-tools-7-5 (= 7.5-18) but it is not going to be installed
                        Depends: cuda-samples-7-5 (= 7.5-18) but it is not going to be installed
                        Depends: cuda-documentation-7-5 (= 7.5-18) but it is not going to be installed
                        Depends: cuda-visual-tools-7-5 (= 7.5-18) but it is not going to be installed
     unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                            Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
    
    Run Code Online (Sandbox Code Playgroud)
  3. 安装和使用aptitude

我的 Ubuntu14.04 操作系统刚刚安装并进行了软件更新并安装了最新的 Nvidia 驱动程序。

你能给一些帮助吗?提前致谢!

小智 8

CUDA 的安装有点棘手。我已经按照以下步骤操作,它对我有用。你也可以参考这个链接

环境确认:

  1. lspci | grep -i nvidia (确认显示NVIDIA的板子信息)

  2. uname -m (确保它是 x86_64)

  3. gcc --version (确保已安装)

安装 CUDA –

  1. cuda_7.5.18_linux.runhttps://developer.nvidia.com/cuda-downloads下载文件

  2. 运行以下命令:

    sudo apt-get install build-essential
    echo blacklist nouveau option nouveau modeset=0 |sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf 
    sudo update-initramfs -u
    
    Run Code Online (Sandbox Code Playgroud)
  3. 重启电脑

  4. 在登录屏幕上,按Ctrl+ Alt+F1并登录到您的用户。

  5. 转到您拥有 CUDA 驱动程序的目录,然后运行

    chmod a+x .
    sudo service lightdm stop
    sudo bash cuda-7.5.18_linux.run --no-opengl-libs
    
    Run Code Online (Sandbox Code Playgroud)
  6. 安装过程中:

    • 接受 EULA 条件
    • 对安装 NVIDIA 驱动程序说“是”
    • 对安装 CUDA Toolkit + 驱动程序说 YES
    • 对安装 CUDA 示例说 YES
    • 拒绝使用 Nvidia 重建任何 Xserver 配置
  7. 检查/dev/nvidia*文件是否存在。如果没有,请执行以下操作

    sudo modprobe nvidia
    
    Run Code Online (Sandbox Code Playgroud)
  8. 设置环境路径变量

    export PATH=/usr/local/cuda-7.5/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
    
    Run Code Online (Sandbox Code Playgroud)
  9. 验证驱动版本

    cat /proc/driver/nvidia/version`
    
    Run Code Online (Sandbox Code Playgroud)
  10. 检查 CUDA 驱动程序版本

    nvcc –V
    
    Run Code Online (Sandbox Code Playgroud)
  11. 再次打开 lightdm

    sudo service lightdm start
    
    Run Code Online (Sandbox Code Playgroud)
  12. Ctrl+ Alt+F7和登录到GUI通过系统

  13. 创建 CUDA 示例,NVIDIA_CUDA-7.5_Samples通过终端转到文件夹,然后运行以下命令:

    make
    cd bin/x86_64/linux/release/
    ./deviceQuery
    ./bandwidthTest
    
    Run Code Online (Sandbox Code Playgroud)

    两个测试最终都应该在终端中输出“PASS”

  14. 重新启动系统


Bru*_* Yo 1

我今天重新启动了Ubuntu,发现还有另一个未满足的依赖项libcog15 : Depends: mesa-driver...(我不记得完整的包名称),所以我曾经apt-get install安装“mesa-driver”。之后CUDA 7.5安装成功。

注意,我的Kernel版本是3.19.0-28-generic,gcc版本是Ubuntu 4.8.4-2ubuntu1~14.04 ,在CUDA 7.5官方文档中没有找到。我会检查它是否真的有效。