在 Debian 机器 10.3 上安装 CUDA

在 Debian 机器 10.3 上安装 CUDA

因此,我尝试在 SageMaker studio 实例上Cuda安装。Debian 10.3ml.g4dn.xlarge

我正在尝试这里的说明:

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Debian&target_version=10&target_type=deblocal

所以,我在 Debian 机器上尝试了:

  dpkg -i cuda-repo-debian10-11-1-local_11.1.0-455.23.05-1_amd64.deb
  apt-get install gnupg
  apt-key add /var/cuda-repo-debian10-11-1-local/7fa2af80.pub
  apt-get install software-properties-common
  add-apt-repository contrib
  apt-get update
  apt-get -y install cuda

但是,最终我得到:

 /tmp/apt-dpkg-install-y7M08M/097-nvidia-persistenced_455.23.05-1_amd64.deb
  E: Sub-process /usr/bin/dpkg returned an error code (1)

有谁知道这是怎么回事吗?

在此输入图像描述

更多日志错误:

    dpkg: error processing archive /tmp/apt-dpkg-install-nkwkn4/097-nvidia-persistenced_455.23.05-1_amd64.deb (--unpack):
     unable to make backup link of './usr/bin/nvidia-persistenced' before installing new version: Invalid cross-device link
    Selecting previously unselected package libxnvctrl0:amd64.
    Preparing to unpack .../098-libxnvctrl0_455.23.05-1_amd64.deb ...
    Unpacking libxnvctrl0:amd64 (455.23.05-1) ...
    Selecting previously unselected package libgdk-pixbuf2.0-common.
    Preparing to unpack .../099-libgdk-pixbuf2.0-common_2.38.1+dfsg-1_all.deb ...
    Unpacking libgdk-pixbuf2.0-common (2.38.1+dfsg-1) ...
    Selecting previously unselected package libgdk-pixbuf2.0-0:amd64.
    Preparing to unpack .../100-libgdk-pixbuf2.0-0_2.38.1+dfsg-1_amd64.deb ...
    Unpacking libgdk-pixbuf2.0-0:amd64 (2.38.1+dfsg-1) ...
    Selecting previously unselected package gtk-update-icon-cache.
    Preparing to unpack .../101-gtk-update-icon-cache_3.24.5-1_amd64.deb ...
    No diversion 'diversion of /usr/sbin/update-icon-caches to /usr/sbin/update-icon-caches.gtk2 by libgtk-3-bin', none removed.
    No diversion 'diversion of /usr/share/man/man8/update-icon-caches.8.gz to /usr/share/man/man8/update-icon-caches.gtk2.8.gz by libgtk-3-bin', none removed.

答案1

我按照在 Debian 10 (Buster) 上找到的说明安装了 CUDA 11.1英伟达网站:

sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/ /"
sudo add-apt-repository contrib
sudo apt-get update
sudo apt-get -y install cuda

这花了很长时间来运行,但是当它完成后,我能够编译并运行一些示例代码。适用于 Linux 的 nVidia CUDA 安装指南很有帮助。

我必须将developer.download.nvidia.com 存储库移至/etc/apt/sources.list 的顶部,然后再进行测试和buster-backports(我在之前尝试让CUDA 工作时添加的内容),以消除未满足的依赖项错误。

相关内容