環(huán)境:
硬件服務器:I5處理器,
顯卡:3080 12G
等。
目標:
測試是否安裝顯卡。
如何找到正確的驅動版本。
安裝顯卡正確的顯卡驅動。
一、檢查是否正確安裝顯卡:
# 檢查使用什么型號的顯卡: yum install pciutils -y # 安裝 lspci | grep VGA # 檢查 lshw -numeric -C display # 檢查product: NVIDIA Corporation 后的產品標識
二、查詢顯卡型號: http://pci-ids.ucw.cz/mods/PC/10de?action=help?help=pci 查詢結果:RTX 3060 三、判斷需要安裝什么型號的顯卡驅動:
方法一、
官網(wǎng)查詢:https://www.nvidia.cn/Download/index.aspx?lang=cn 根據(jù)自己的系統(tǒng)和顯卡下載對應的顯卡驅動,下載下來是一個.run文件 方法二:系統(tǒng)檢測工具判斷
# 安裝依賴: yum -y install epel-release yum -y install gcc binutils wget yum -y install kernel-devel # 導入密鑰 rpm --importhttps://www.elrepo.org/RPM-GPG-KEY-elrepo.org # 安裝elrepo源 rpm -Uvhhttp://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm # 安裝 yum install nvidia-detect -y # 檢測顯卡驅動 nvidia-detect-v # 檢測顯卡驅動 yum search kmod-nvidia # 比如 440.36,可用于校驗在第3步下載的顯卡驅動版本是否合適 # 提示:不建議使用rpmfusion安裝nvidia的顯卡驅動,因為開源的顯卡驅動在性能方面跟nvidia官方的閉源顯卡驅動有一定的差距
的到顯卡驅動的版本:525.85.05
下載驅動:
# 1、比如: wget https://us.download.nvidia.cn/XFree86/Linux-x86_64/510.68.02/NVIDIA-Linux-x86_64-510.68.02.run # 替換上面鏈接中:510.68.02,為你自己顯卡驅動版本:525.85.05 得到如下鏈接: wget https://us.download.nvidia.cn/XFree86/Linux-x86_64/525.85.05/NVIDIA-Linux-x86_64-525.85.05.run # 2、下載驅動 服務器執(zhí)行 wget https://us.download.nvidia.cn/XFree86/Linux-x86_64/525.85.05/NVIDIA-Linux-x86_64-525.85.05.run # 3、得到驅動文件:NVIDIA-Linux-x86_64-525.85.05.run
四、安裝驅動前準備工作一
必須做:
#由于centos 安裝完成以后自帶顯卡驅動,會與nvidia顯卡驅動沖突,所以需對原來的驅動進行處理。[root@xiaoyafei ~]# lsmod | grep nouveaunouveau 1899494 0 mxm_wmi 13021 1 nouveau i2c_algo_bit 13413 1 nouveau drm_kms_helper 186531 1 nouveau ttm 96673 1 nouveau drm 456166 3 ttm,drm_kms_helper,nouveau video 24538 2 nouveau,asus_wmi wmi 21636 3 mxm_wmi,nouveau,asus_wmi# 代表需要處理# 一、 禁用nouveau # 這個是centos自帶的顯卡驅動,會與nvidia顯卡驅動沖突# 1、查看系統(tǒng)是否啟用nouveau,如果運行下邊命令則會出現(xiàn)一串英文和數(shù)字,如果沒有任何顯示則表示禁用lsmod | grep nouveau# 2、編輯文件dist-blacklist.confvim /usr/lib/modprobe.d/dist-blacklist.conf# 在文件最后加入下邊兩行代碼: blacklist nouveau options nouveau modeset=0 #blacklist nvidiafb #注釋調這個,如下圖# 3、運行下列命令mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak# 執(zhí)行時間稍長,耐心dracut /boot/initramfs-$(uname -r).img $(uname -r) lsmod | grep nouveau # 查看是否禁用# 如果有返回,則重啟計算機:reboot
查看是否有反饋
總結:
該方法適用對象:所有顯卡型號的安裝,都必須處理自帶的顯卡驅動。
五、安裝顯卡驅動:
安裝依賴:
# 1、安裝rpm包 yum install gcc dkms gcc-c++ # 2、安裝依賴環(huán)境 yum install kernel-devel gcc -y``` yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
拿到三節(jié)中的驅動文件:NVIDIA-Linux-x86_64-525.85.05.run,進行安裝驅動
賦權:
chmod u+x NVIDIA-Linux-x86_64-525.85.05.run
安裝 這里選擇下載的驅動文件安裝。
# 1、安裝顯卡驅動 sh NVIDIA-Linux-x86_64-525.85.05.run # 2、遇到報錯: unable to find the kernel source tree for the currently running kernel.........,使用下面命令安裝,3.10.0-1062.18.1.el7.x86_64需要改成自己的目錄 sh NVIDIA-Linux-x86_64-440.64.run --kernel-source-path=/usr/src/kernels/3.10.0-1062.18.1.el7.x86_64 -k $(uname -r) # 3、安裝進行時: Would you like to register the kernel module sources with DKMS? **選擇yes** 是否選擇32-bit的xxx? **選擇no** Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? **選擇yes** # 安裝完以后運行:nvidia-smi查看是否成功,如果沒有任何顯示,重啟后再輸入命令查看
文章來源:http://www.zghlxwxcb.cn/news/detail-526922.html
報錯1、:
ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.
解決辦法:
# 清空yum源緩存 yum clean all # 選擇自己的內核版本執(zhí)行 sh NVIDIA-Linux-x86_64-525.85.05.run --kernel-source-path=/usr/src/kernels/3.10.0-1160.90.1.el7.x86_64 -k $(uname -r)
文章來源地址http://www.zghlxwxcb.cn/news/detail-526922.html
到了這里,關于Centos7.9環(huán)境下,如何檢查及安裝顯卡3080驅動-物理機的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!