CentOS6安装Nvidia显卡驱动


下载驱动NVIDIA-Linux-x86_64-470.82.01.run

https://www.nvidia.cn/Download/index.aspx?lang=cn



修改配置文件

vi /etc/modprobe.d/blacklist.conf 

#blacklist nvidiafb         # 注释掉,不拉黑NVIDIA驱动

blacklist nouveau           # 添加这一行
options nouveau modeset=0   # 添加这一行,如果不添加这一行 ,开机还是会启动nouveau


重新建立initramfs image文件

# 命令1
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

# 命令2
dracut /boot/initramfs-$(uname -r).img $(uname -r)


修改/etc/inittab

将最后一行【id:5:initdefault:】里的5改成3;5是图形化界面,3是命令行界面


增加可执行权限  

chmod +x NVIDIA-Linux-x86_64-470.82.01.run


运行驱动 

./NVIDIA-Linux-x86_64-470.82.01.run


报错1

error you appear to be running an x server


解决1

将所有的vnc服务关闭


报错2

找不到kernal-source


解决2

# 安装source
yum install kernel-devel

# 安装
./NVIDIA-Linux-x86_64-470.82.01.run --kernel-source-path=/usr/src/kernels/2.6.32-754.35.1.el6.x86_64


检测是否已经安装了显卡驱动


方式1

yum install lshw -y
 
[root@qd2 ~]# lshw -c video|grep product
product: MGA G200eH3
product: NVIDIA Corporation
product: NVIDIA Corporation
product: NVIDIA Corporation
product: NVIDIA Corporation


方式2

[root@qd2 ~]# ls /dev/|grep nvidia
nvidia0
nvidia1
nvidia2
nvidia3
nvidia-caps
nvidiactl


方式3

[root@qd2 ~]# cat /proc/devices|grep nvidia
195 nvidia-frontend
244 nvidia-nvswitch
245 nvidia-nvlink
246 nvidia-caps


方式4

[root@qd2 ~]# lsmod|grep nvidia
nvidia_drm              1118  0
nvidia              35258157  0
nvidiafb               41968  0
fb_ddc                  1663  1 nvidiafb
i2c_algo_bit            5903  2 igb,nvidiafb
vgastate                9573  1 nvidiafb
i2c_core               29164  5 igb,nvidia,nvidiafb,fb_ddc,i2c_algo_bit


修改/etc/inittab

将最后一行【id:3:initdefault:】里的3改成5;5是图形化界面,3是命令行界面


文章最后更新时间: 2021-11-18 10:40:14