安装 nvidia-cuda-toolkit 会删除 nvidia-smi

安装 nvidia-cuda-toolkit 会删除 nvidia-smi

我已经nvidia-cuda-toolkit在我的 ubuntu 22.04 上安装了,它删除了nvidia-smi。它删除了libnvidia-compute-515 nvidia-utils-515,也删除了nvidia-smi。如果我尝试使用 更新我的驱动程序sudo ubuntu-drivers autoinstall,它会显示:

The following packages were automatically installed and are no longer required:
  libaccinj64-11.5 libcub-dev libcublas11 libcublaslt11 libcudart11.0 libcufft10 libcufftw10 libcurand10 libcusolver11 libcusolvermg11 libcusparse11 libnppc11 libnppial11 libnppicc11 libnppidei11
  libnppif11 libnppig11 libnppim11 libnppist11 libnppisu11 libnppitc11 libnpps11 libnvblas11 libnvjpeg11 libnvrtc-builtins11.5 libnvrtc11.2 libnvtoolsext1 libnvvm4 libtbb-dev libtbb12 libtbbmalloc2
  libthrust-dev libvdpau-dev nvidia-cuda-gdb nvidia-cuda-toolkit-doc nvidia-opencl-dev ocl-icd-opencl-dev opencl-c-headers opencl-clhpp-headers
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libgles2:i386 libnvidia-cfg1-515 libnvidia-common-515 libnvidia-compute-515 libnvidia-compute-515:i386 libnvidia-decode-515 libnvidia-decode-515:i386 libnvidia-encode-515 libnvidia-encode-515:i386
  libnvidia-extra-515 libnvidia-fbc1-515 libnvidia-fbc1-515:i386 libnvidia-gl-515 libnvidia-gl-515:i386 libopengl0:i386 libxnvctrl0 nvidia-compute-utils-515 nvidia-dkms-515 nvidia-prime
  nvidia-settings nvidia-utils-515 screen-resolution-extra xserver-xorg-video-nvidia-515
The following packages will be REMOVED:
  libcuinj64-11.5 libnvidia-compute-495 libnvidia-ml-dev nvidia-cuda-dev nvidia-cuda-toolkit nvidia-profiler nvidia-visual-profiler
The following NEW packages will be installed:
  libgles2:i386 libnvidia-cfg1-515 libnvidia-common-515 libnvidia-compute-515 libnvidia-compute-515:i386 libnvidia-decode-515 libnvidia-decode-515:i386 libnvidia-encode-515 libnvidia-encode-515:i386
  libnvidia-extra-515 libnvidia-fbc1-515 libnvidia-fbc1-515:i386 libnvidia-gl-515 libnvidia-gl-515:i386 libopengl0:i386 libxnvctrl0 nvidia-compute-utils-515 nvidia-dkms-515 nvidia-driver-515
  nvidia-prime nvidia-settings nvidia-utils-515 screen-resolution-extra xserver-xorg-video-nvidia-515
0 upgraded, 24 newly installed, 7 to remove and 0 not upgraded.
 

它提到要删除和其他软件包。如何在更新驱动程序时不删除它指出要删除的其他软件包的情况下,nvidia-cuda-toolkit获取已nvidia-cuda-toolkit安装和安装的GPU 使用情况统计信息?nvidia-smi

我想为 Tensorflow 安装 GPU。它总是提示缺少软件包。

答案1

问题是 的最新版本与nvidia-cuda-toolkit最新的驱动程序版本不匹配。在您给出的示例中,nvidia-cuda-toolkit需要libnvidia-compute-495,但最新的驱动程序 (515) 依赖于libnvidia-compute-515。它们不能共存,因此它唯一的选择是删除依赖于其他版本的软件包。

您可以通过安装与最新版本所依赖的版本相匹配的特定驱动程序版本来解决此问题nvidia-cuda-toolkit,即在您的情况下apt install nvidia-driver-495

在撰写本文时,与 Ubuntu 22.04 中匹配的 CUDA 版本的最新驱动程序版本是 510。

答案2

我遇到了完全相同的问题,如果我正确理解了您的评论,您也需要它来运行 Tensorflow。为了使 Tensorflow 在 GPU 上运行,您只需要驱动程序、CUDA 和 cuDNN。

所以就我而言,这是有效的:

  1. 安装 GPU 驱动程序
  2. 按照以下步骤安装 CUDAhttps://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
  3. 安装 cuDNNhttps://developer.nvidia.com/cudnn

我知道这不能直接回答你的问题,但我无法发表评论,如果它仅适用于 Tensorflow,这应该可行。至少在我的计算机上,Tensorflow 现在能够使用 GPU。

相关内容