RHEL6上安装nvidia显卡驱动

一:下载nvidia显卡驱动,从nvidia的官方网站根据显卡的型号下载相应的驱动文件
http://www.nvidia.cn/Download/index.aspx?lang=cn

二:在字符界面下(运行级3)运行驱动安装程序,在RHEL6上因为Nouveau的关系会出现下面的错误,因此需要将该模块禁用掉
[root@rhel6 ~]# sh NVIDIA-Linux-x86_64-275.09.07.run
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 275.09.07....................................................................................................................


Please read the following LICENSE and then select either "Accept" to accept the license and continue with the installation, or select "Do Not Accept" to abort the installation.

   Accept                     Do Not Accept 

ERROR: The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must bedisabled before proceeding.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
 
[root@rhel6 ~]# lsmod  |grep nouveau
nouveau               537914  1
ttm                    46942  1 nouveau
drm_kms_helper         32113  1 nouveau
drm                   200778  3 nouveau,ttm,drm_kms_helper
i2c_algo_bit            5664  1 nouveau
video                  20966  1 nouveau
i2c_core               31274  5 i2c_nforce2,nouveau,drm_kms_helper,drm,i2c_algo_bit

将该模块加入黑名单:
[root@rhel6 ~]# tail -1 /etc/modprobe.d/blacklist.conf
blacklist nouveau

备份原先的初始化内存文件系统
[root@rhel6 ~]# mv /boot/initramfs-2.6.32-71.el6.x86_64.img  /boot/initramfs-2.6.32-71.el6.x86_64.img.orig

使用dracut命令重新生成initramfs文件,并重启
[root@rhel6 ~]# dracut -v /boot/initramfs-2.6.32-71.el6.x86_64.img  2.6.32-71.el6.x86_64
[root@rhel6 ~]# reboot

重启后发现该模块依然被加载
[root@rhel6 ~]# lsmod |grep nouveau
nouveau               537914  1
ttm                    46942  1 nouveau
drm_kms_helper         32113  1 nouveau
drm                   200778  3 nouveau,ttm,drm_kms_helper
i2c_algo_bit            5664  1 nouveau
video                  20966  1 nouveau
powernow_k8            16298  0
freq_table              4847  2 cpufreq_ondemand,powernow_k8
i2c_core               31274  5 nouveau,drm_kms_helper,drm,i2c_algo_bit,i2c_nforce2

在grub.conf文件中将改模块加入黑名单
[root@rhel6 ~]# grep -1 default  /etc/grub.conf
rdblacklist=nouveau
default=1
timeout=1
将nouveau.ko内核对象文件移除
[root@rhel6 ~]# mv /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko  /tmp

重启后发现该模块以及没有被加载了
[root@rhel6 ~]# reboot
[root@rhel6 ~]# lsmod |grep no
powernow_k8            16298  0
freq_table              4847  2 cpufreq_ondemand,powernow_k8

接下来就可以在字符界面一路回车将显卡驱动装好了,但移除nouveau.ko文件后,RHEL6启动界面将会变成进度条形式,原来的光圈启动将会消失!

三:测试

 

在Red Hat系列系统(如CentOS、Fedora等)上安装NVIDIA显卡驱动,通常需要遵循以下步骤: **步骤1: 确认硬件支持** 首先,你需要确认你的计算机配备了兼容的NVIDIA GPU,并检查其型号是否被官方支持。 **步骤2: 更新包管理器** ```bash sudo yum update sudo yum install kernel-devel-$(uname -r) # 如果kernel不是最新版本,可能需要这个 ``` **步骤3: 添加NVIDIA官方软件源** 对于一些较旧的RHEL/CentOS版本,可以使用社区版yum源: ```bash echo "deb http://developer.download.nvidia.com/rhel7/x86_64/ 7u5 repo/" | sudo tee /etc/yum.repos.d/nvidia.repo echo "nouveau off" > /etc/modprobe.conf ``` 对于较新的版本,推荐使用CUDA repositories: ```bash wget https://www.nvidia.com/Download/index.aspx?lang=en-us -O cuda-repo-rhel7-11-0-local.gpg sudo mv cuda-repo-rhel7-11-0-local.gpg /etc/pki/rpm-gpg/ sudo rpm --import /etc/pki/rpm-gpg/cuda-repo-rhel7-11-0-local.gpg echo "[cuda-repo-11-0-local] name=CUDA Repository for RHEL 7 - 11.x Local baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel7-11-local/ gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/rhel7-11-local/cuda-repo-rhel7-11-0-local.gpg enabled=1 autoremove=1 priority=999" | sudo tee /etc/yum.repos.d/cuda-repo-11-0-local.repo ``` **步骤4: 安装驱动** ```bash sudo yum install nvidia-driver nvidia-utils ``` 如果你需要最新的驱动,可以用`dnf`替换`yum`并指定特定版本,例如 `nvidia-driver-470` 或者 `nvidia-driver-460`。 **步骤5: 配置启动和登录时自动加载显卡** 编辑 `/etc/X11/xorg.conf` 或创建 `/etc/modprobe.d/blacklist-nouveau.conf` 并添加 `blacklist nouveau` 和 `options nouveau modeset=0` 来禁用内建驱动。 **步骤6: 重启电脑** 完成上述操作后,重启计算机以便新驱动生效。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值