显卡驱动https://www.bilibili.com/video/BV1Zc41137tU/?spm_id_from333.999.0.0vd_sourced75fca5b05d8be06d13cfffd2f4f7ab5使用recommended的驱动open和无open的区别在于无open更适合发挥NVIDIA显卡的全部功能和性能特别是GPU加速计算等任务https://www.nvidia.cn/content/DriverDownloads/confirmation.php?url/XFree86/Linux-x86_64/530.41.03/NVIDIA-Linux-x86_64-530.41.03.runlangustypeTITAN(base)delldell-Precision-3630-Tower:~$ nvidia-detector nvidia-driver-530(base)delldell-Precision-3630-Tower:~$ lspci-v|grep-A1-iVGA00:02.0 VGA compatible controller: Intel Corporation Device 3e9a(rev 02)(prog-if 00[VGA controller])DeviceName: Onboard - Video -- 01:00.0 VGA compatible controller: NVIDIA Corporation Device2504(rev a1)(prog-if 00[VGA controller])Subsystem: ASUSTeK Computer Inc. Device 881d ---------------------------------------------------------------------------- 根据您提供的信息您的计算机上有两个显卡 Intel Corporation Device 3e9a(rev 02)设备名称Onboard - Video这是一块集成的显卡通常用于处理基本图形任务。 NVIDIA Corporation Device2504(rev a1)子系统ASUSTeK Computer Inc. Device 881d这是一块独立的NVIDIA显卡通常用于处理更复杂的图形任务如游戏或图形设计。 请注意Intel的显卡通常被用作计算机的集成显卡而独立显卡如NVIDIA或AMD显卡通常用于提供更高性能的图形处理能力。 计算机上的NVIDIA显卡是NVIDIA Corporation Device 2504 (rev a1)型号是GeForce RTX 3060**因此选择驱动是530 ----------------------------------------------------------------------------(base)delldell-Precision-3630-Tower:/home$find.-nameNVIDIA*./dell/Downloads/NVIDIA-Linux-x86_64-530.41.03.run ./dell/Downloads/NVIDIA-Linux-x86_64-535.54.03.run ./dell/dell-bak/dell/baum/NVIDIA-Linux-x86_64-530.41.03.run ./dell/dell-bak/dell/Downloads/NVIDIA-Linux-x86_64-530.41.03.run ./dell/dell-bak/dell/Documents/NVIDIA Nsight Systems ./dell/dell-bak/dell/anaconda3/lib/python3.10/site-packages/cmake/data/share/cmake-3.25/Modules/Compiler/NVIDIA-DetermineCompiler.cmake ./dell/dell-bak/dell/anaconda3/lib/python3.10/site-packages/cmake/data/share/cmake-3.25/Modules/Compiler/NVIDIA-CUDA.cmake ./dell/dell-bak/dell/anaconda3/pkgs/cudnn-7.6.5.32-h01f27c4_1/info/licenses/NVIDIA_SLA_cuDNN_Support.txt ./dell/dell-bak/dell/anaconda3/pkgs/cudatoolkit-10.2.89-h713d32c_11/info/licenses/NVIDIA_EULA ./dell/dell-bak/dell/anaconda3/pkgs/cudatoolkit-10.2.89-h713d32c_11/info/recipe/NVIDIA_EULA ./dell/a/NVIDIA-Linux-x86_64-525.78.01.run ./dell/a/NVIDIA-Linux-x86_64-515.65.01.run** 修改驱动为530并且nvidia-smi显示重启后的结果如下图cudahttps://developer.nvidia.com/cuda-11-8-0-download-archive?target_osLinuxtarget_archx86_64DistributionUbuntutarget_version20.04target_typerunfile_localhttps://www.bilibili.com/video/BV1bW4y197Mo/?spm_id_from333.788.recommend_more_video.-1vd_sourced75fca5b05d8be06d13cfffd2f4f7ab5wgethttps://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.runsudoshcuda_11.8.0_520.61.05_linux.run以上问题是因为以下这步没有把文件下载完全wgethttps://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run 需要路径 /nvme/cudaspacevim~/.bashrcexportTMPDIR/nvme/cudaspaceexportPATH/usr/local/cuda-11.8/bin:${PATH}exportLD_LIBRARY_PATH/usr/local/cuda-11.8/lib64:${LD_LIBRARY_PATH}source~/.bashrc#最后结果(base)delldell-Precision-3630-Tower:~$ nvcc--versionnvcc: NVIDIA(R)Cuda compiler driver Copyright(c)2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0cudnnhttps://developer.nvidia.com/rdp/cudnn-downloadsudoapt-getinstallzlib1g#下载安装包到downloadsudodpkg-icudnn-local-repo-ubuntu2004-8.9.2.26_1.0-1_amd64.debsudocp/var/cudnn-local-repo-ubuntu2004-8.9.2.26/cudnn-local-6D0A7AE1-keyring.gpg /usr/share/keyrings/sudoapt-getupdate(base)delldell-Precision-3630-Tower:~$sudoapt-getinstalllibcudnn88.9.2.26-1cuda11.8 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libcudnn80upgraded,1newly installed,0to remove and15not upgraded. Need to get0B/465 MB of archives. After this operation,1,162MB of additional disk space will be used. Get:1 file:/var/cudnn-local-repo-ubuntu2004-8.9.2.26 libcudnn88.9.2.26-1cuda11.8[465MB]Selecting previously unselected package libcudnn8.(Reading database...207154files and directories currently installed.)Preparing to unpack.../libcudnn8_8.9.2.26-1cuda11.8_amd64.deb... Unpacking libcudnn8(8.9.2.26-1cuda11.8)... Setting up libcudnn8(8.9.2.26-1cuda11.8)...(base)delldell-Precision-3630-Tower:~$sudoapt-getinstalllibcudnn8-dev8.9.2.26-1cuda11.8 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libcudnn8-dev0upgraded,1newly installed,0to remove and15not upgraded. Need to get0B/455 MB of archives. After this operation,1,348MB of additional disk space will be used. Get:1 file:/var/cudnn-local-repo-ubuntu2004-8.9.2.26 libcudnn8-dev8.9.2.26-1cuda11.8[455MB]Selecting previously unselected package libcudnn8-dev.(Reading database...207171files and directories currently installed.)Preparing to unpack.../libcudnn8-dev_8.9.2.26-1cuda11.8_amd64.deb... Unpacking libcudnn8-dev(8.9.2.26-1cuda11.8)... Setting up libcudnn8-dev(8.9.2.26-1cuda11.8)... update-alternatives: using /usr/include/x86_64-linux-gnu/cudnn_v8.h to provide /usr/include/cudnn.h(libcudnn)inauto mode(base)delldell-Precision-3630-Tower:~$sudoapt-getinstalllibcudnn8-samples8.9.2.26-1cuda11.8 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libcudnn8-samples0upgraded,1newly installed,0to remove and15not upgraded. Need to get0B/1,665 kB of archives. After this operation,2,169kB of additional disk space will be used. Get:1 file:/var/cudnn-local-repo-ubuntu2004-8.9.2.26 libcudnn8-samples8.9.2.26-1cuda11.8[1,665kB]Selecting previously unselected package libcudnn8-samples.(Reading database...207204files and directories currently installed.)Preparing to unpack.../libcudnn8-samples_8.9.2.26-1cuda11.8_amd64.deb... Unpacking libcudnn8-samples(8.9.2.26-1cuda11.8)... Setting up libcudnn8-samples(8.9.2.26-1cuda11.8)...#验证安装成功$cp-r/usr/src/cudnn_samples_v8/$HOME$cd$HOME/cudnn_samples_v8/mnistCUDNN$makecleanmake#出现以下问题base)delldell-Precision-3630-Tower:~/cudnn_samples_v8/mnistCUDNN$makecleanmakerm-rf*orm-rfmnistCUDNN CUDA_VERSION is11080Linking agains cublasLttrueCUDA VERSION:11080TARGET ARCH: x86_64 HOST_ARCH: x86_64 TARGET OS: linux SMS:35505360616270727580868790test.c:1:10: fatal error: FreeImage.h: No suchfileor directory1|#include FreeImage.h|^~~~~~~~~~~~~ compilation terminated.WARNING - FreeImage is notsetup correctly. Please ensure FreeImage issetup correctly.[]/usr/local/cuda/bin/nvcc -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include-ccbing-m64-gencodearchcompute_35,codesm_35-gencodearchcompute_50,codesm_50-gencodearchcompute_53,codesm_53-gencodearchcompute_60,codesm_60-gencodearchcompute_61,codesm_61-gencodearchcompute_62,codesm_62-gencodearchcompute_70,codesm_70-gencodearchcompute_72,codesm_72-gencodearchcompute_75,codesm_75-gencodearchcompute_80,codesm_80-gencodearchcompute_86,codesm_86-gencodearchcompute_87,codesm_87-gencodearchcompute_90,codesm_90-gencodearchcompute_90,codecompute_90-ofp16_dev.o-cfp16_dev.cu[]g -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include-ofp16_emu.o-cfp16_emu.cpp[]g -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include-omnistCUDNN.o-cmnistCUDNN.cpp[]/usr/local/cuda/bin/nvcc-ccbing-m64-gencodearchcompute_35,codesm_35-gencodearchcompute_50,codesm_50-gencodearchcompute_53,codesm_53-gencodearchcompute_60,codesm_60-gencodearchcompute_61,codesm_61-gencodearchcompute_62,codesm_62-gencodearchcompute_70,codesm_70-gencodearchcompute_72,codesm_72-gencodearchcompute_75,codesm_75-gencodearchcompute_80,codesm_80-gencodearchcompute_86,codesm_86-gencodearchcompute_87,codesm_87-gencodearchcompute_90,codesm_90-gencodearchcompute_90,codecompute_90-omnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64-lcublasLt-LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux-lcudart-lcublas-lcudnn-lfreeimage-lstdc-lm$sudoapt-getinstalllibfreeimage3 libfreeimage-dev $./mnistCUDNN#以上输出为以下则安装成功... Result of classification:135Test passed!