TKE集群ubuntu 16.04节点更新GPU驱动和CUDA Toolkit

2021-07-19 18:05:40 浏览数 (1)

前置条件

  1. 我是切换到root下执行的,如果非root用户,请按需sudo
  2. 本例为ubuntu16.04系统升级驱动和CUDA Toolkit 原版本: Driver Version: 410.79 CUDA Version: 10.0 目标版本: Driver Version: 440.95.01 CUDA Version: 10.2 其他场景或系统可能操作会略有不同,即便同系统,可能依据使用情况不同,按照此文档操作结果可能也有所出入,请以实际情况为准


操作步骤

1. 首先确认CUDA和驱动以及硬件设备、系统、软件包的兼容性,可参考如下网站自查

Release Notes :: CUDA Toolkit Documentation

CUDA Compatibility

2. 显示当前系统GPU相关的驱动版本为410.79

代码语言:txt复制
root@VM-1-43-ubuntu:~# dpkg -l |grep '^ii' |grep nvidia
ii  libnvidia-container-tools                       1.0.0~rc.2-1                             amd64        NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64                      1.0.0~rc.2-1                             amd64        NVIDIA container runtime library
ii  nvidia-410                                      410.79-0ubuntu1                          amd64        NVIDIA binary driver - version 410.79
ii  nvidia-410-dev                                  410.79-0ubuntu1                          amd64        NVIDIA binary Xorg driver development files
ii  nvidia-container-runtime                        2.0.0 docker17.12.1-1                    amd64        NVIDIA container runtime
ii  nvidia-container-runtime-hook                   1.4.0-1                                  amd64        NVIDIA container runtime hook
ii  nvidia-diag-driver-local-repo-ubuntu1604-410.79 1.0-1                                    amd64        nvidia-diag-driver-local repository configuration files
ii  nvidia-modprobe                                 410.79-0ubuntu1                          amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-opencl-icd-410                           410.79-0ubuntu1                          amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                                    0.8.2                                    amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                                 410.79-0ubuntu1                          amd64        Tool for configuring the NVIDIA graphics driver

3. 显示当前系统GPU的CUDA版本为10.0

代码语言:txt复制
root@VM-1-43-ubuntu:~# dpkg -l |grep '^ii' |grep cuda
ii  cuda                                            10.0.130-1                               amd64        CUDA meta-package
ii  cuda-10-0                                       10.0.130-1                               amd64        CUDA 10.0 meta-package
ii  cuda-command-line-tools-10-0                    10.0.130-1                               amd64        CUDA command-line tools
ii  cuda-compiler-10-0                              10.0.130-1                               amd64        CUDA compiler
ii  cuda-cublas-10-0                                10.0.130-1                               amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-10-0                            10.0.130-1                               amd64        CUBLAS native dev links, headers
ii  cuda-cudart-10-0                                10.0.130-1                               amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-10-0                            10.0.130-1                               amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-10-0                                 10.0.130-1                               amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-10-0                             10.0.130-1                               amd64        CUFFT native dev links, headers
ii  cuda-cuobjdump-10-0                             10.0.130-1                               amd64        CUDA cuobjdump
ii  cuda-cupti-10-0                                 10.0.130-1                               amd64        CUDA profiling tools interface.
ii  cuda-curand-10-0                                10.0.130-1                               amd64        CURAND native runtime libraries
ii  cuda-curand-dev-10-0                            10.0.130-1                               amd64        CURAND native dev links, headers
ii  cuda-cusolver-10-0                              10.0.130-1                               amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-10-0                          10.0.130-1                               amd64        CUDA solver native dev links, headers
ii  cuda-cusparse-10-0                              10.0.130-1                               amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-10-0                          10.0.130-1                               amd64        CUSPARSE native dev links, headers
ii  cuda-demo-suite-10-0                            10.0.130-1                               amd64        Demo suite for CUDA
ii  cuda-documentation-10-0                         10.0.130-1                               amd64        CUDA documentation
ii  cuda-driver-dev-10-0                            10.0.130-1                               amd64        CUDA Driver native dev stub library
ii  cuda-drivers                                    410.79-1                                 amd64        CUDA Driver meta-package
ii  cuda-gdb-10-0                                   10.0.130-1                               amd64        CUDA-GDB
ii  cuda-gpu-library-advisor-10-0                   10.0.130-1                               amd64        CUDA GPU Library Advisor.
ii  cuda-libraries-10-0                             10.0.130-1                               amd64        CUDA Libraries 10.0 meta-package
ii  cuda-libraries-dev-10-0                         10.0.130-1                               amd64        CUDA Libraries 10.0 development meta-package
ii  cuda-license-10-0                               10.0.130-1                               amd64        CUDA licenses
ii  cuda-memcheck-10-0                              10.0.130-1                               amd64        CUDA-MEMCHECK
ii  cuda-misc-headers-10-0                          10.0.130-1                               amd64        CUDA miscellaneous headers
ii  cuda-npp-10-0                                   10.0.130-1                               amd64        NPP native runtime libraries
ii  cuda-npp-dev-10-0                               10.0.130-1                               amd64        NPP native dev links, headers
ii  cuda-nsight-10-0                                10.0.130-1                               amd64        CUDA nsight
ii  cuda-nsight-compute-10-0                        10.0.130-1                               amd64        NVIDIA Nsight Compute
ii  cuda-nvcc-10-0                                  10.0.130-1                               amd64        CUDA nvcc
ii  cuda-nvdisasm-10-0                              10.0.130-1                               amd64        CUDA disassembler
ii  cuda-nvgraph-10-0                               10.0.130-1                               amd64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-dev-10-0                           10.0.130-1                               amd64        NVGRAPH native dev links, headers
ii  cuda-nvjpeg-10-0                                10.0.130-1                               amd64        NVJPEG native runtime libraries
ii  cuda-nvjpeg-dev-10-0                            10.0.130-1                               amd64        NVJPEG native dev links, headers
ii  cuda-nvml-dev-10-0                              10.0.130-1                               amd64        NVML native dev links, headers
ii  cuda-nvprof-10-0                                10.0.130-1                               amd64        CUDA Profiler tools
ii  cuda-nvprune-10-0                               10.0.130-1                               amd64        CUDA nvprune
ii  cuda-nvrtc-10-0                                 10.0.130-1                               amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-10-0                             10.0.130-1                               amd64        NVRTC native dev links, headers
ii  cuda-nvtx-10-0                                  10.0.130-1                               amd64        NVIDIA Tools Extension
ii  cuda-nvvp-10-0                                  10.0.130-1                               amd64        CUDA nvvp
ii  cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48 1.0-1                                    amd64        cuda repository configuration files
ii  cuda-runtime-10-0                               10.0.130-1                               amd64        CUDA Runtime 10.0 meta-package
ii  cuda-samples-10-0                               10.0.130-1                               amd64        CUDA example applications
ii  cuda-toolkit-10-0                               10.0.130-1                               amd64        CUDA Toolkit 10.0 meta-package
ii  cuda-tools-10-0                                 10.0.130-1                               amd64        CUDA Tools meta-package
ii  cuda-visual-tools-10-0                          10.0.130-1                               amd64        CUDA visual tools
ii  libcuda1-410                                    410.79-0ubuntu1                          amd64        NVIDIA CUDA runtime library

4. 按需下载所需的驱动和CUDA Toolkit

驱动:Advanced Driver Search

CUDA Toolkit:CUDA Toolkit Archive

5. 解包下载的驱动和CUDA Toolkit

代码语言:txt复制
root@VM-1-43-ubuntu:~# dpkg -i nvidia-driver-local-repo-ubuntu1604-440.95.01_1.0-1_amd64.deb
Selecting previously unselected package nvidia-driver-local-repo-ubuntu1604-440.95.01.
(Reading database ... 141191 files and directories currently installed.)
Preparing to unpack nvidia-driver-local-repo-ubuntu1604-440.95.01_1.0-1_amd64.deb ...
Unpacking nvidia-driver-local-repo-ubuntu1604-440.95.01 (1.0-1) ...
Setting up nvidia-driver-local-repo-ubuntu1604-440.95.01 (1.0-1) ...

root@VM-1-43-ubuntu:~# dpkg -i cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
Selecting previously unselected package cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01.
(Reading database ... 141217 files and directories currently installed.)
Preparing to unpack cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb ...
Unpacking cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01 (1.0-1) ...
Setting up cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01 (1.0-1) ...

6. 更新apt源,可以看到,已经找到新的驱动和CUDA Toolkit

代码语言:txt复制
root@VM-1-43-ubuntu:~# apt-get update
Get:1 file:/var/cuda-repo-10-0-local-10.0.130-410.48  InRelease
Ign:1 file:/var/cuda-repo-10-0-local-10.0.130-410.48  InRelease
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  InRelease
Ign:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  InRelease
Get:3 file:/var/nvidia-diag-driver-local-repo-410.79  InRelease
Ign:3 file:/var/nvidia-diag-driver-local-repo-410.79  InRelease
Get:4 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  InRelease
Ign:4 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  InRelease
Get:5 file:/var/cuda-repo-10-0-local-10.0.130-410.48  Release [574 B]
Get:6 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release [574 B]
Get:7 file:/var/nvidia-diag-driver-local-repo-410.79  Release [574 B]
Get:8 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  Release [564 B]
Get:5 file:/var/cuda-repo-10-0-local-10.0.130-410.48  Release [574 B]
Get:6 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release [574 B]
Get:7 file:/var/nvidia-diag-driver-local-repo-410.79  Release [574 B]
Get:9 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release.gpg [819 B]
Get:8 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  Release [564 B]
Get:9 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release.gpg [819 B]
Get:10 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  Release.gpg [819 B]
Get:10 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  Release.gpg [819 B]
Hit:12 <http://mirrors.tencentyun.com/ubuntu> xenial InRelease
Get:14 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Packages [21.0 kB]
Get:15 file:/var/nvidia-driver-local-repo-ubuntu1604-440.95.01  Packages [7,012 B]
Hit:16 <http://mirrors.tencentyun.com/ubuntu> xenial-security InRelease
Hit:17 <http://mirrors.tencentyun.com/ubuntu> xenial-updates InRelease
Reading package lists... Done

7. 安装新的软件包

代码语言:txt复制
apt-get install cuda-drivers cuda

8. 显示系统更新后的GPU相关的驱动版本(为440.95.01)

代码语言:txt复制
 root@VM-1-43-ubuntu:~# dpkg -l |grep '^ii' |grep nvidia
   ii  libnvidia-container-tools                         1.0.0~rc.2-1                             amd64        NVIDIA container runtime library (command-line tools)
   ii  libnvidia-container1:amd64                        1.0.0~rc.2-1                             amd64        NVIDIA container runtime library
   ii  nvidia-440                                        440.95.01-0ubuntu1                       amd64        NVIDIA binary driver - version 440.95.01
   ii  nvidia-440-dev                                    440.95.01-0ubuntu1                       amd64        NVIDIA binary Xorg driver development files
   ii  nvidia-container-runtime                          2.0.0 docker17.12.1-1                    amd64        NVIDIA container runtime
   ii  nvidia-container-runtime-hook                     1.4.0-1                                  amd64        NVIDIA container runtime hook
   ii  nvidia-diag-driver-local-repo-ubuntu1604-410.79   1.0-1                                    amd64        nvidia-diag-driver-local repository configuration files
   ii  nvidia-driver-local-repo-ubuntu1604-440.95.01     1.0-1                                    amd64        nvidia-driver-local repository configuration files
   ii  nvidia-modprobe                                   440.95.01-0ubuntu1                       amd64        Load the NVIDIA kernel driver and create device files
   ii  nvidia-opencl-icd-440                             440.95.01-0ubuntu1                       amd64        NVIDIA OpenCL ICD
   ii  nvidia-prime                                      0.8.2                                    amd64        Tools to enable NVIDIA's Prime
   ii  nvidia-settings                                   440.95.01-0ubuntu1                       amd64        Tool for configuring the NVIDIA graphics driver

9. 检查安装的CUDA包,此时可以看到仍包含10.0的CUDA

代码语言:txt复制
root@VM-1-43-ubuntu:~# dpkg -l |grep '^ii' |grep cuda
ii  cuda                                              10.2.89-1                                amd64        CUDA meta-package
ii  cuda-10-0                                         10.0.130-1                               amd64        CUDA 10.0 meta-package
ii  cuda-10-2                                         10.2.89-1                                amd64        CUDA 10.2 meta-package
ii  cuda-command-line-tools-10-0                      10.0.130-1                               amd64        CUDA command-line tools
ii  cuda-command-line-tools-10-2                      10.2.89-1                                amd64        CUDA command-line tools
ii  cuda-compiler-10-0                                10.0.130-1                               amd64        CUDA compiler
ii  cuda-compiler-10-2                                10.2.89-1                                amd64        CUDA compiler
ii  cuda-cublas-10-0                                  10.0.130-1                               amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-10-0                              10.0.130-1                               amd64        CUBLAS native dev links, headers
ii  cuda-cudart-10-0                                  10.0.130-1                               amd64        CUDA Runtime native Libraries
ii  cuda-cudart-10-2                                  10.2.89-1                                amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-10-0                              10.0.130-1                               amd64        CUDA Runtime native dev links, headers
ii  cuda-cudart-dev-10-2                              10.2.89-1                                amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-10-0                                   10.0.130-1                               amd64        CUFFT native runtime libraries
ii  cuda-cufft-10-2                                   10.2.89-1                                amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-10-0                               10.0.130-1                               amd64        CUFFT native dev links, headers
ii  cuda-cufft-dev-10-2                               10.2.89-1                                amd64        CUFFT native dev links, headers
ii  cuda-cuobjdump-10-0                               10.0.130-1                               amd64        CUDA cuobjdump
ii  cuda-cuobjdump-10-2                               10.2.89-1                                amd64        CUDA cuobjdump
ii  cuda-cupti-10-0                                   10.0.130-1                               amd64        CUDA profiling tools interface.
ii  cuda-cupti-10-2                                   10.2.89-1                                amd64        CUDA profiling tools runtime libs.
ii  cuda-cupti-dev-10-2                               10.2.89-1                                amd64        CUDA profiling tools interface.
ii  cuda-curand-10-0                                  10.0.130-1                               amd64        CURAND native runtime libraries
ii  cuda-curand-10-2                                  10.2.89-1                                amd64        CURAND native runtime libraries
ii  cuda-curand-dev-10-0                              10.0.130-1                               amd64        CURAND native dev links, headers
ii  cuda-curand-dev-10-2                              10.2.89-1                                amd64        CURAND native dev links, headers
ii  cuda-cusolver-10-0                                10.0.130-1                               amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-10-2                                10.2.89-1                                amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-10-0                            10.0.130-1                               amd64        CUDA solver native dev links, headers
ii  cuda-cusolver-dev-10-2                            10.2.89-1                                amd64        CUDA solver native dev links, headers
ii  cuda-cusparse-10-0                                10.0.130-1                               amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-10-2                                10.2.89-1                                amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-10-0                            10.0.130-1                               amd64        CUSPARSE native dev links, headers
ii  cuda-cusparse-dev-10-2                            10.2.89-1                                amd64        CUSPARSE native dev links, headers
ii  cuda-demo-suite-10-0                              10.0.130-1                               amd64        Demo suite for CUDA
ii  cuda-demo-suite-10-2                              10.2.89-1                                amd64        Demo suite for CUDA
ii  cuda-documentation-10-0                           10.0.130-1                               amd64        CUDA documentation
ii  cuda-documentation-10-2                           10.2.89-1                                amd64        CUDA documentation
ii  cuda-driver-dev-10-0                              10.0.130-1                               amd64        CUDA Driver native dev stub library
ii  cuda-driver-dev-10-2                              10.2.89-1                                amd64        CUDA Driver native dev stub library
ii  cuda-drivers                                      440.95.01-1                              amd64        CUDA Driver meta-package, branch-agnostic
ii  cuda-drivers-440                                  440.95.01-1                              amd64        CUDA Driver meta-package, branch-specific
ii  cuda-gdb-10-0                                     10.0.130-1                               amd64        CUDA-GDB
ii  cuda-gdb-10-2                                     10.2.89-1                                amd64        CUDA-GDB
ii  cuda-gpu-library-advisor-10-0                     10.0.130-1                               amd64        CUDA GPU Library Advisor.
ii  cuda-libraries-10-0                               10.0.130-1                               amd64        CUDA Libraries 10.0 meta-package
ii  cuda-libraries-10-2                               10.2.89-1                                amd64        CUDA Libraries 10.2 meta-package
ii  cuda-libraries-dev-10-0                           10.0.130-1                               amd64        CUDA Libraries 10.0 development meta-package
ii  cuda-libraries-dev-10-2                           10.2.89-1                                amd64        CUDA Libraries 10.2 development meta-package
ii  cuda-license-10-0                                 10.0.130-1                               amd64        CUDA licenses
ii  cuda-license-10-2                                 10.2.89-1                                amd64        CUDA licenses
ii  cuda-memcheck-10-0                                10.0.130-1                               amd64        CUDA-MEMCHECK
ii  cuda-memcheck-10-2                                10.2.89-1                                amd64        CUDA-MEMCHECK
ii  cuda-misc-headers-10-0                            10.0.130-1                               amd64        CUDA miscellaneous headers
ii  cuda-misc-headers-10-2                            10.2.89-1                                amd64        CUDA miscellaneous headers
ii  cuda-npp-10-0                                     10.0.130-1                               amd64        NPP native runtime libraries
ii  cuda-npp-10-2                                     10.2.89-1                                amd64        NPP native runtime libraries
ii  cuda-npp-dev-10-0                                 10.0.130-1                               amd64        NPP native dev links, headers
ii  cuda-npp-dev-10-2                                 10.2.89-1                                amd64        NPP native dev links, headers
ii  cuda-nsight-10-0                                  10.0.130-1                               amd64        CUDA nsight
ii  cuda-nsight-10-2                                  10.2.89-1                                amd64        CUDA nsight
ii  cuda-nsight-compute-10-0                          10.0.130-1                               amd64        NVIDIA Nsight Compute
ii  cuda-nsight-compute-10-2                          10.2.89-1                                amd64        NVIDIA Nsight Compute
ii  cuda-nsight-systems-10-2                          10.2.89-1                                amd64        NVIDIA Nsight Systems
ii  cuda-nvcc-10-0                                    10.0.130-1                               amd64        CUDA nvcc
ii  cuda-nvcc-10-2                                    10.2.89-1                                amd64        CUDA nvcc
ii  cuda-nvdisasm-10-0                                10.0.130-1                               amd64        CUDA disassembler
ii  cuda-nvdisasm-10-2                                10.2.89-1                                amd64        CUDA disassembler
ii  cuda-nvgraph-10-0                                 10.0.130-1                               amd64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-10-2                                 10.2.89-1                                amd64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-dev-10-0                             10.0.130-1                               amd64        NVGRAPH native dev links, headers
ii  cuda-nvgraph-dev-10-2                             10.2.89-1                                amd64        NVGRAPH native dev links, headers
ii  cuda-nvjpeg-10-0                                  10.0.130-1                               amd64        NVJPEG native runtime libraries
ii  cuda-nvjpeg-10-2                                  10.2.89-1                                amd64        NVJPEG native runtime libraries
ii  cuda-nvjpeg-dev-10-0                              10.0.130-1                               amd64        NVJPEG native dev links, headers
ii  cuda-nvjpeg-dev-10-2                              10.2.89-1                                amd64        NVJPEG native dev links, headers
ii  cuda-nvml-dev-10-0                                10.0.130-1                               amd64        NVML native dev links, headers
ii  cuda-nvml-dev-10-2                                10.2.89-1                                amd64        NVML native dev links, headers
ii  cuda-nvprof-10-0                                  10.0.130-1                               amd64        CUDA Profiler tools
ii  cuda-nvprof-10-2                                  10.2.89-1                                amd64        CUDA Profiler tools
ii  cuda-nvprune-10-0                                 10.0.130-1                               amd64        CUDA nvprune
ii  cuda-nvprune-10-2                                 10.2.89-1                                amd64        CUDA nvprune
ii  cuda-nvrtc-10-0                                   10.0.130-1                               amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-10-2                                   10.2.89-1                                amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-10-0                               10.0.130-1                               amd64        NVRTC native dev links, headers
ii  cuda-nvrtc-dev-10-2                               10.2.89-1                                amd64        NVRTC native dev links, headers
ii  cuda-nvtx-10-0                                    10.0.130-1                               amd64        NVIDIA Tools Extension
ii  cuda-nvtx-10-2                                    10.2.89-1                                amd64        NVIDIA Tools Extension
ii  cuda-nvvp-10-0                                    10.0.130-1                               amd64        CUDA nvvp
ii  cuda-nvvp-10-2                                    10.2.89-1                                amd64        CUDA nvvp
ii  cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48   1.0-1                                    amd64        cuda repository configuration files
ii  cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01 1.0-1                                    amd64        cuda repository configuration files
ii  cuda-runtime-10-0                                 10.0.130-1                               amd64        CUDA Runtime 10.0 meta-package
ii  cuda-runtime-10-2                                 10.2.89-1                                amd64        CUDA Runtime 10.2 meta-package
ii  cuda-samples-10-0                                 10.0.130-1                               amd64        CUDA example applications
ii  cuda-samples-10-2                                 10.2.89-1                                amd64        CUDA example applications
ii  cuda-sanitizer-api-10-2                           10.2.89-1                                amd64        CUDA Sanitizer API
ii  cuda-toolkit-10-0                                 10.0.130-1                               amd64        CUDA Toolkit 10.0 meta-package
ii  cuda-toolkit-10-2                                 10.2.89-1                                amd64        CUDA Toolkit 10.2 meta-package
ii  cuda-tools-10-0                                   10.0.130-1                               amd64        CUDA Tools meta-package
ii  cuda-tools-10-2                                   10.2.89-1                                amd64        CUDA Tools meta-package
ii  cuda-visual-tools-10-0                            10.0.130-1                               amd64        CUDA visual tools
ii  cuda-visual-tools-10-2                            10.2.89-1                                amd64        CUDA visual tools
ii  libcuda1-440                                      440.95.01-0ubuntu1                       amd64        NVIDIA CUDA runtime library

10. autoremove卸载多余包

代码语言:txt复制
root@VM-1-43-ubuntu:~# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  cuda-10-0 cuda-command-line-tools-10-0 cuda-compiler-10-0 cuda-cublas-10-0 cuda-cublas-dev-10-0 cuda-cudart-10-0 cuda-cudart-dev-10-0 cuda-cufft-10-0 cuda-cufft-dev-10-0
  cuda-cuobjdump-10-0 cuda-cupti-10-0 cuda-curand-10-0 cuda-curand-dev-10-0 cuda-cusolver-10-0 cuda-cusolver-dev-10-0 cuda-cusparse-10-0 cuda-cusparse-dev-10-0 cuda-demo-suite-10-0
  cuda-documentation-10-0 cuda-driver-dev-10-0 cuda-gdb-10-0 cuda-gpu-library-advisor-10-0 cuda-libraries-10-0 cuda-libraries-dev-10-0 cuda-license-10-0 cuda-memcheck-10-0
  cuda-misc-headers-10-0 cuda-npp-10-0 cuda-npp-dev-10-0 cuda-nsight-10-0 cuda-nsight-compute-10-0 cuda-nvcc-10-0 cuda-nvdisasm-10-0 cuda-nvgraph-10-0 cuda-nvgraph-dev-10-0
  cuda-nvjpeg-10-0 cuda-nvjpeg-dev-10-0 cuda-nvml-dev-10-0 cuda-nvprof-10-0 cuda-nvprune-10-0 cuda-nvrtc-10-0 cuda-nvrtc-dev-10-0 cuda-nvtx-10-0 cuda-nvvp-10-0 cuda-runtime-10-0
  cuda-samples-10-0 cuda-toolkit-10-0 cuda-tools-10-0 cuda-visual-tools-10-0
0 upgraded, 0 newly installed, 49 to remove and 402 not upgraded.
After this operation, 3,136 MB disk space will be freed.
Do you want to continue? [Y/n]

11. 再次查看,正常

代码语言:txt复制
root@VM-1-43-ubuntu:~# dpkg -l |grep '^ii' |grep cuda
ii  cuda                                              10.2.89-1                                amd64        CUDA meta-package
ii  cuda-10-2                                         10.2.89-1                                amd64        CUDA 10.2 meta-package
ii  cuda-command-line-tools-10-2                      10.2.89-1                                amd64        CUDA command-line tools
ii  cuda-compiler-10-2                                10.2.89-1                                amd64        CUDA compiler
ii  cuda-cudart-10-2                                  10.2.89-1                                amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-10-2                              10.2.89-1                                amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-10-2                                   10.2.89-1                                amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-10-2                               10.2.89-1                                amd64        CUFFT native dev links, headers
ii  cuda-cuobjdump-10-2                               10.2.89-1                                amd64        CUDA cuobjdump
ii  cuda-cupti-10-2                                   10.2.89-1                                amd64        CUDA profiling tools runtime libs.
ii  cuda-cupti-dev-10-2                               10.2.89-1                                amd64        CUDA profiling tools interface.
ii  cuda-curand-10-2                                  10.2.89-1                                amd64        CURAND native runtime libraries
ii  cuda-curand-dev-10-2                              10.2.89-1                                amd64        CURAND native dev links, headers
ii  cuda-cusolver-10-2                                10.2.89-1                                amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-10-2                            10.2.89-1                                amd64        CUDA solver native dev links, headers
ii  cuda-cusparse-10-2                                10.2.89-1                                amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-10-2                            10.2.89-1                                amd64        CUSPARSE native dev links, headers
ii  cuda-demo-suite-10-2                              10.2.89-1                                amd64        Demo suite for CUDA
ii  cuda-documentation-10-2                           10.2.89-1                                amd64        CUDA documentation
ii  cuda-driver-dev-10-2                              10.2.89-1                                amd64        CUDA Driver native dev stub library
ii  cuda-drivers                                      440.95.01-1                              amd64        CUDA Driver meta-package, branch-agnostic
ii  cuda-drivers-440                                  440.95.01-1                              amd64        CUDA Driver meta-package, branch-specific
ii  cuda-gdb-10-2                                     10.2.89-1                                amd64        CUDA-GDB
ii  cuda-libraries-10-2                               10.2.89-1                                amd64        CUDA Libraries 10.2 meta-package
ii  cuda-libraries-dev-10-2                           10.2.89-1                                amd64        CUDA Libraries 10.2 development meta-package
ii  cuda-license-10-2                                 10.2.89-1                                amd64        CUDA licenses
ii  cuda-memcheck-10-2                                10.2.89-1                                amd64        CUDA-MEMCHECK
ii  cuda-misc-headers-10-2                            10.2.89-1                                amd64        CUDA miscellaneous headers
ii  cuda-npp-10-2                                     10.2.89-1                                amd64        NPP native runtime libraries
ii  cuda-npp-dev-10-2                                 10.2.89-1                                amd64        NPP native dev links, headers
ii  cuda-nsight-10-2                                  10.2.89-1                                amd64        CUDA nsight
ii  cuda-nsight-compute-10-2                          10.2.89-1                                amd64        NVIDIA Nsight Compute
ii  cuda-nsight-systems-10-2                          10.2.89-1                                amd64        NVIDIA Nsight Systems
ii  cuda-nvcc-10-2                                    10.2.89-1                                amd64        CUDA nvcc
ii  cuda-nvdisasm-10-2                                10.2.89-1                                amd64        CUDA disassembler
ii  cuda-nvgraph-10-2                                 10.2.89-1                                amd64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-dev-10-2                             10.2.89-1                                amd64        NVGRAPH native dev links, headers
ii  cuda-nvjpeg-10-2                                  10.2.89-1                                amd64        NVJPEG native runtime libraries
ii  cuda-nvjpeg-dev-10-2                              10.2.89-1                                amd64        NVJPEG native dev links, headers
ii  cuda-nvml-dev-10-2                                10.2.89-1                                amd64        NVML native dev links, headers
ii  cuda-nvprof-10-2                                  10.2.89-1                                amd64        CUDA Profiler tools
ii  cuda-nvprune-10-2                                 10.2.89-1                                amd64        CUDA nvprune
ii  cuda-nvrtc-10-2                                   10.2.89-1                                amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-10-2                               10.2.89-1                                amd64        NVRTC native dev links, headers
ii  cuda-nvtx-10-2                                    10.2.89-1                                amd64        NVIDIA Tools Extension
ii  cuda-nvvp-10-2                                    10.2.89-1                                amd64        CUDA nvvp
ii  cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48   1.0-1                                    amd64        cuda repository configuration files
ii  cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01 1.0-1                                    amd64        cuda repository configuration files
ii  cuda-runtime-10-2                                 10.2.89-1                                amd64        CUDA Runtime 10.2 meta-package
ii  cuda-samples-10-2                                 10.2.89-1                                amd64        CUDA example applications
ii  cuda-sanitizer-api-10-2                           10.2.89-1                                amd64        CUDA Sanitizer API
ii  cuda-toolkit-10-2                                 10.2.89-1                                amd64        CUDA Toolkit 10.2 meta-package
ii  cuda-tools-10-2                                   10.2.89-1                                amd64        CUDA Tools meta-package
ii  cuda-visual-tools-10-2                            10.2.89-1                                amd64        CUDA visual tools
ii  libcuda1-440                                      440.95.01-0ubuntu1                       amd64        NVIDIA CUDA runtime library

12. 重启节点后查看驱动和CUDA Toolkit版本

代码语言:txt复制
root@VM-1-43-ubuntu:~# nvidia-smi
Fri Jul 16 16:53:56 2021
 ----------------------------------------------------------------------------- 
| NVIDIA-SMI 440.95.01    Driver Version: 440.95.01    CUDA Version: 10.2     |
|------------------------------- ---------------------- ---------------------- 
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|=============================== ====================== ======================|
|   0  Tesla T4            On   | 00000000:00:09.0 Off |                    0 |
| N/A   41C    P8     9W /  70W |      0MiB / 15109MiB |      0%      Default |
 ------------------------------- ---------------------- ---------------------- 

 ----------------------------------------------------------------------------- 
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
 ----------------------------------------------------------------------------- 

0 人点赞