gpt4 book ai didi

ubuntu - 在 Ubuntu 16.04 上安装 CUDA(未满足的依赖项)

转载 作者:行者123 更新时间:2023-12-04 18:40:17 27 4
gpt4 key购买 nike

我是 Ubuntu 的新手,正在尝试在其上安装 CUDA。我就是做不到。

我安装了 Nvidia R390 驱动程序(这很麻烦)。

然后我按照以下说明进行操作:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

当我点击 sudo apt-get install cuda

弹出以下错误:

     Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
cuda-cublas-dev-9-1 : Depends: cuda-cublas-9-1 (>= 9.1.85.3) but it is not installed
cuda-cufft-dev-9-1 : Depends: cuda-cufft-9-1 (>= 9.1.85) but it is not installed
cuda-curand-dev-9-1 : Depends: cuda-curand-9-1 (>= 9.1.85) but it is not installed
cuda-cusolver-dev-9-1 : Depends: cuda-cusolver-9-1 (>= 9.1.85) but it is not installed
cuda-cusparse-dev-9-1 : Depends: cuda-cusparse-9-1 (>= 9.1.85) but it is not installed
cuda-libraries-9-1 : Depends: cuda-nvrtc-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-nvgraph-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cusolver-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cublas-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cufft-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-curand-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cusparse-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-npp-9-1 (>= 9.1.85) but it is not installed
cuda-npp-dev-9-1 : Depends: cuda-npp-9-1 (>= 9.1.85) but it is not installed
cuda-nvgraph-dev-9-1 : Depends: cuda-nvgraph-9-1 (>= 9.1.85) but it is not installed
cuda-nvrtc-dev-9-1 : Depends: cuda-nvrtc-9-1 (>= 9.1.85) but it is not installed
cuda-toolkit-9-1 : Depends: cuda-nvml-dev-9-1 (>= 9.1.85) but it is not installed
cuda-visual-tools-9-1 : Depends: cuda-nvml-dev-9-1 but it is not installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

所以我使用sudo apt-get -f install,但是出现了以下错误:
Preparing to unpack .../cuda-nvrtc-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvrtc-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvrtc-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cusolver-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cusolver-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cusolver-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cublas-9-1_9.1.85.3-1_amd64.deb ...
Unpacking cuda-cublas-9-1 (9.1.85.3-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cufft-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cufft-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cufft-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-curand-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-curand-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-curand-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-cusparse-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cusparse-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cusparse-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-npp-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-npp-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-npp-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-nvml-dev-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvml-dev-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvml-dev-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-nvgraph-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvgraph-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvgraph-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
/var/cache/apt/archives/cuda-nvrtc-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cusolver-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb
/var/cache/apt/archives/cuda-cufft-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-curand-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cusparse-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-npp-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-nvml-dev-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-nvgraph-9-1_9.1.85-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人可以帮忙吗?我的想法不多了。谢谢!

最佳答案

  • here 下载最新版本
  • 然后停止你 X 显示管理器(lightdm 是 ubuntu 的默认值)
    sudo service lightdm stop
  • 安装显示驱动程序(推荐)和 CUDA 工具包
    sudo chmod +x  cuda_9.0_linux.run
    sudo ./cuda_9.0_linux.run
  • 安装后(将这些行添加到 .bashrc 文件的末尾)
    export CUDA_HOME=/usr/local/cuda-9.0
    export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH

    PATH=${CUDA_HOME}/bin:${PATH}
    export PATH
  • CUDNN 安装(可选)

    HERE 获取 CUDNN 内容
    tar -xzvf cudnn-X.Y.tgz
    cd cudnn-X.Y/cuda
    sudo cp -r * /usr/local/cuda-9.0
    sudo ldconfig

    请记住检查您要安装的 tensorflow 版本支持哪些版本的 cuda 和 cudnn。 (例如 cuda9.0,cudnn7 用于 tensorflow 1.7,这是我写这个答案时的最新版本)
  • 关于ubuntu - 在 Ubuntu 16.04 上安装 CUDA(未满足的依赖项),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49727596/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com