PyTorch 在 21.10 上无法识别我的可用 GPU

PyTorch 在 21.10 上无法识别我的可用 GPU

我在 Nvidia 510 上安装了 CUDA 11.3,每当我想要运行推理时,都会出现此错误:

    torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available

这是我的 CUDA:

> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

当我这样做时nvidia-smi,我得到了这个输出:

nvidia-smi
Command 'nvidia-smi' not found, but can be installed with:
sudo apt install nvidia-utils-418-server  # version 418.226.00-0ubuntu0.21.10.2, or
sudo apt install nvidia-utils-450-server  # version 450.172.01-0ubuntu0.21.10.1
sudo apt install nvidia-utils-470         # version 470.103.01-0ubuntu0.21.10.1
sudo apt install nvidia-utils-470-server  # version 470.103.01-0ubuntu0.21.10.1
sudo apt install nvidia-utils-510         # version 510.54-0ubuntu0.21.10.1
sudo apt install nvidia-utils-510-server  # version 510.47.03-0ubuntu0.21.10.1
sudo apt install nvidia-utils-390         # version 390.143-0ubuntu2
sudo apt install nvidia-utils-460         # version 460.80-0ubuntu3
sudo apt install nvidia-utils-460-server  # version 460.73.01-0ubuntu2
sudo apt install nvidia-utils-465         # version 465.27-0ubuntu3

当我继续安装sudo apt install nvidia-utils-510并重新启动时,出现此错误:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

输出sudo dpkg -l | grep -i nvidia

ii  libaccinj64-11.3:amd64                        11.3.111~11.3.1-4                          amd64        NVIDIA ACCINJ Library (64-bit)
ii  libcublas11:amd64                             11.5.1.109~11.3.1-4                        amd64        NVIDIA cuBLAS Library
ii  libcublaslt11:amd64                           11.5.1.109~11.3.1-4                        amd64        NVIDIA cuBLASLt Library
ii  libcudart11.0:amd64                           11.3.109~11.3.1-4                          amd64        NVIDIA CUDA Runtime Library
ii  libcufft10:amd64                              11.1.1+~10.4.2.109~11.3.1-4                amd64        NVIDIA cuFFT Library
ii  libcufftw10:amd64                             11.1.1+~10.4.2.109~11.3.1-4                amd64        NVIDIA cuFFTW Library
ii  libcuinj64-11.3:amd64                         11.3.111~11.3.1-4                          amd64        NVIDIA CUINJ Library (64-bit)
ii  libcupti-dev:amd64                            11.3.111~11.3.1-4                          amd64        NVIDIA CUDA Profiler Tools Interface development files
ii  libcupti-doc                                  11.3.111~11.3.1-4                          all          NVIDIA CUDA Profiler Tools Interface documentation
ii  libcupti11.3:amd64                            11.3.111~11.3.1-4                          amd64        NVIDIA CUDA Profiler Tools Interface runtime library
ii  libcurand10:amd64                             11.1.1+~10.2.4.109~11.3.1-4                amd64        NVIDIA cuRAND Library
ii  libcusolver11:amd64                           11.1.2.109~11.3.1-4                        amd64        NVIDIA cuSOLVER Library
ii  libcusolvermg11:amd64                         11.1.2.109~11.3.1-4                        amd64        NVIDIA cuSOLVERmg Library
ii  libcusparse11:amd64                           11.6.0.109~11.3.1-4                        amd64        NVIDIA cuSPARSE Library
ii  libnppc11:amd64                               11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives core runtime library
ii  libnppial11:amd64                             11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Arithmetic and Logic
ii  libnppicc11:amd64                             11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Color Conversion
ii  libnppidei11:amd64                            11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Data Exchange and Initialization
ii  libnppif11:amd64                              11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Filters
ii  libnppig11:amd64                              11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Geometry transforms
ii  libnppim11:amd64                              11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Morphological operations
ii  libnppist11:amd64                             11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Statistics
ii  libnppisu11:amd64                             11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Support
ii  libnppitc11:amd64                             11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives lib for Image Threshold and Compare
ii  libnpps11:amd64                               11.3.3.95~11.3.1-4                         amd64        NVIDIA Performance Primitives for signal processing runtime library
ii  libnvidia-cfg1-470:amd64                      470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-470                          470.103.01-0ubuntu0.21.10.1                all          Shared files used by the NVIDIA libraries
rc  libnvidia-compute-440:amd64                   440.33.01-0ubuntu1                         amd64        NVIDIA libcompute package
ii  libnvidia-compute-470:amd64                   470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA libcompute package
ii  libnvidia-compute-470:i386                    470.103.01-0ubuntu0.21.10.1                i386         NVIDIA libcompute package
rc  libnvidia-compute-510:amd64                   510.54-0ubuntu0.21.10.1                    amd64        NVIDIA libcompute package
ii  libnvidia-container-tools                     1.9.0-1                                    amd64        NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64                    1.9.0-1                                    amd64        NVIDIA container runtime library
ii  libnvidia-decode-470:amd64                    470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-470:i386                     470.103.01-0ubuntu0.21.10.1                i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-egl-wayland1:amd64                  1:1.1.7-2build1                            amd64        Wayland EGL External Platform library -- shared library
ii  libnvidia-encode-470:amd64                    470.103.01-0ubuntu0.21.10.1                amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-470:i386                     470.103.01-0ubuntu0.21.10.1                i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-470:amd64                     470.103.01-0ubuntu0.21.10.1                amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-470:amd64                      470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-470:i386                       470.103.01-0ubuntu0.21.10.1                i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-470:amd64                        470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-470:i386                         470.103.01-0ubuntu0.21.10.1                i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-470:amd64                      470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ifr1-470:i386                       470.103.01-0ubuntu0.21.10.1                i386         NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ml-dev:amd64                        11.3.58~11.3.1-4                           amd64        NVIDIA Management Library (NVML) development files
ii  libnvjpeg11:amd64                             11.5.0.109~11.3.1-4                        amd64        NVIDIA JPEG library (nvJPEG)
ii  libnvrtc-builtins11.3:amd64                   11.3.109~11.3.1-4                          amd64        CUDA Runtime Compilation (NVIDIA NVRTC Builtins Library)
ii  libnvrtc11.2:amd64                            11.3.109~11.3.1-4                          amd64        CUDA Runtime Compilation (NVIDIA NVRTC Library)
ii  libnvtoolsext1:amd64                          11.3.109~11.3.1-4                          amd64        NVIDIA Tools Extension Library
ii  libnvvm4:amd64                                11.3.109~11.3.1-4                          amd64        NVIDIA NVVM Library
rc  linux-modules-nvidia-470-5.13.0-22-generic    5.13.0-22.22+2                             amd64        Linux kernel nvidia modules for version 5.13.0-22
rc  linux-modules-nvidia-470-5.13.0-23-generic    5.13.0-23.23+1                             amd64        Linux kernel nvidia modules for version 5.13.0-23
rc  linux-modules-nvidia-470-5.13.0-25-generic    5.13.0-25.26                               amd64        Linux kernel nvidia modules for version 5.13.0-25
rc  linux-modules-nvidia-470-5.13.0-27-generic    5.13.0-27.29                               amd64        Linux kernel nvidia modules for version 5.13.0-27
rc  linux-modules-nvidia-470-5.13.0-28-generic    5.13.0-28.31+1                             amd64        Linux kernel nvidia modules for version 5.13.0-28
rc  linux-modules-nvidia-470-5.13.0-30-generic    5.13.0-30.33                               amd64        Linux kernel nvidia modules for version 5.13.0-30
rc  linux-modules-nvidia-470-5.13.0-35-generic    5.13.0-35.40                               amd64        Linux kernel nvidia modules for version 5.13.0-35
rc  linux-modules-nvidia-470-5.13.0-37-generic    5.13.0-37.42                               amd64        Linux kernel nvidia modules for version 5.13.0-37
rc  linux-modules-nvidia-510-5.13.0-35-generic    5.13.0-35.40                               amd64        Linux kernel nvidia modules for version 5.13.0-35
rc  linux-modules-nvidia-510-5.13.0-37-generic    5.13.0-37.42                               amd64        Linux kernel nvidia modules for version 5.13.0-37
rc  linux-objects-nvidia-470-5.13.0-22-generic    5.13.0-22.22+2                             amd64        Linux kernel nvidia modules for version 5.13.0-22 (objects)
rc  linux-objects-nvidia-470-5.13.0-23-generic    5.13.0-23.23+1                             amd64        Linux kernel nvidia modules for version 5.13.0-23 (objects)
rc  linux-objects-nvidia-470-5.13.0-25-generic    5.13.0-25.26                               amd64        Linux kernel nvidia modules for version 5.13.0-25 (objects)
rc  linux-objects-nvidia-470-5.13.0-27-generic    5.13.0-27.29                               amd64        Linux kernel nvidia modules for version 5.13.0-27 (objects)
rc  linux-objects-nvidia-470-5.13.0-28-generic    5.13.0-28.31+1                             amd64        Linux kernel nvidia modules for version 5.13.0-28 (objects)
rc  linux-objects-nvidia-470-5.13.0-30-generic    5.13.0-30.33                               amd64        Linux kernel nvidia modules for version 5.13.0-30 (objects)
ii  linux-objects-nvidia-470-5.13.0-35-generic    5.13.0-35.40                               amd64        Linux kernel nvidia modules for version 5.13.0-35 (objects)
ii  linux-objects-nvidia-470-5.13.0-37-generic    5.13.0-37.42                               amd64        Linux kernel nvidia modules for version 5.13.0-37 (objects)
ii  linux-objects-nvidia-510-5.13.0-35-generic    5.13.0-35.40                               amd64        Linux kernel nvidia modules for version 5.13.0-35 (objects)
ii  linux-objects-nvidia-510-5.13.0-37-generic    5.13.0-37.42                               amd64        Linux kernel nvidia modules for version 5.13.0-37 (objects)
ii  linux-signatures-nvidia-5.13.0-35-generic     5.13.0-35.40                               amd64        Linux kernel signatures for nvidia modules for version 5.13.0-35-generic
ii  linux-signatures-nvidia-5.13.0-37-generic     5.13.0-37.42                               amd64        Linux kernel signatures for nvidia modules for version 5.13.0-37-generic
ii  nvidia-compute-utils-470                      470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA compute utilities
rc  nvidia-compute-utils-510                      510.54-0ubuntu0.21.10.1                    amd64        NVIDIA compute utilities
ii  nvidia-container-toolkit                      1.9.0-1                                    amd64        NVIDIA container runtime hook
ii  nvidia-cuda-dev:amd64                         11.3.1-4                                   amd64        NVIDIA CUDA development files
ii  nvidia-cuda-gdb                               11.3.109~11.3.1-4                          amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit                           11.3.1-4                                   amd64        NVIDIA CUDA development toolkit
ii  nvidia-cuda-toolkit-doc                       11.3.1-4                                   all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-dkms-470                               470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA DKMS package
rc  nvidia-dkms-510                               510.54-0ubuntu0.21.10.1                    amd64        NVIDIA DKMS package
ii  nvidia-docker2                                2.10.0-1                                   all          nvidia-docker CLI wrapper
ii  nvidia-driver-470                             470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-470                      470.103.01-0ubuntu0.21.10.1                amd64        Shared files used with the kernel module
rc  nvidia-kernel-common-510                      510.54-0ubuntu0.21.10.1                    amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-470                      470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA kernel source package
ii  nvidia-opencl-dev:amd64                       11.3.1-4                                   amd64        NVIDIA OpenCL development files
ii  nvidia-prime                                  0.8.17.1                                   all          Tools to enable NVIDIA's Prime
ii  nvidia-profiler                               11.3.111~11.3.1-4                          amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                               470.57.01-0ubuntu3.1~0.21.10.1             amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-470                              470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA driver support binaries
ii  nvidia-visual-profiler                        11.3.111~11.3.1-4                          amd64        NVIDIA Visual Profiler for CUDA and OpenCL
ii  screen-resolution-extra                       0.18.1                                     all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-470                 470.103.01-0ubuntu0.21.10.1                amd64        NVIDIA binary Xorg driver

我哪里做错了?

相关内容