centos安装显卡 亲测
先下载驱动
https://www.nvidia.com/en-us/drivers/unix/linux-amd64-display-archive/
1.安装编译环境:gcc、kernel-devel、kernel-headers (如果已安装,可不用在装)
yum -y install gcc kernel-devel "kernel-devel-uname-r == $(uname -r)" dkms
2.修改/etc/modprobe.d/blacklist.conf 文件,以阻止 nouveau 模块的加载
方法: 添加blacklist nouveau,注释掉blacklist nvidiafb(如果存在)
blacklist.conf不存在时,执行下面的脚本
echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist.conf
3.重新建立initramfs image文件
# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
# dracut /boot/initramfs-$(uname -r).img $(uname -r)
4.执行以下安装脚本[]
./NVIDIA-Linux-x86_64-460.73.01.run --kernel-source-path=/usr/src/kernels/3.10.0-514.el7.x86_64 -k $(uname -r) --dkms -s
##遇到问题解决
You appear to be running an X server; please exit X before installing.
systemctl status gdm.service
The Nouveau kernel driver is currently in use by your system
ps -ax | grep X
kill pid
设置默认进入图形界面的命令是:systemctl set-default graphical.target
设置默认进入文本界面的命令是:systemctl set-default multi-user.target
我们运行
systemctl set-default multi-user.target
reboot ##重启
Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with
--glvnd-egl-config-path.
上一步没安装 libglvnd
解决方法
不影响正常安装,回车继续即可.或者
指定--kernel-source-path选项,例如:
./NVIDIA-Linux-x86_64-384.98.run --kernel-source-path=/usr/src/kernels/3.10.0-693.11.1.el7.x86_64/
ERROR: Failed to find dkms on the system!
ERROR: Failed to install the kernel module through DKMS. No kernel module was installed; please try installing again without DKMS, or check the DKMS logs for more information.
未安装dkms
https://pkgs.org/download/dkms
https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/d/dkms-2.8.4-1.el7.noarch.rpm
下载,关联安装[需要联网或者有yum源]
yum -y install dkms-2.8.4-1.el7.noarch.rpm
安装,完成