电脑显卡的安装驱动

发布时间: 2023-04-16 15:28 阅读: 文章来源:转载

一、驱动下载和安装依赖

驱动下载地址: https://www.nvidia.cn/geforce/drivers/ (选择自己显卡对应的版本)

yum -y install gcc kernel-devel "kernel-devel-uname-r == $(uname -r)" dkms "kernel-devel-uname-r == $(uname -r)"二、阻止 nouveau 模块的加载

修改/etc/modprobe.d/blacklist.conf 文件:

如果存在blacklist.conf,添加blacklist nouveau,注释掉blacklist nvidiafb;

如果不存在,执行:

echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist.conf四、关闭桌面//修改运行级别为文本模式,无桌面环境可跳过此步sudo systemctl set-default multi-user.target//重新启动, 使用root用户登陆reboot五、执行安装脚本

查看操作系统的发行版号

uname -r

执行安装脚本

./NVIDIA-Linux-x86_64-450.57.run --kernel-source-path=/usr/src/kernels/3.10.0-1127.el7.x86_64 -k $(uname -r) --dkms -s

执行 nvidia-smi 看到以下信息说明安装成功

[root@localhost ~]# nvidia-smiTue Jul 21 22:55:12 2020+-----------------------------------------------------------------------------+| NVIDIA-SMI 450.57Driver Version: 450.57CUDA Version: 11.0 ||-------------------------------+----------------------+----------------------+| GPUNamePersistence-M| Bus-IdDisp.A | Volatile Uncorr. ECC || FanTempPerfPwr:Usage/Cap| Memory-Usage | GPU-UtilCompute M. ||||MIG M. ||===============================+======================+======================||0GeForce GTX 960 Off| 00000000:04:00.0 Off |N/A || 37%40CP029W / 120W |0MiB /4043MiB |2%Default ||||N/A |+-------------------------------+----------------------+----------------------++-----------------------------------------------------------------------------+| Processes:||GPUGICIPIDTypeProcess nameGPU Memory ||IDIDUsage||=============================================================================||No running processes found |+-----------------------------------------------------------------------------+六、开启桌面环境//设置运行级别systemctl set-default graphical.target//重启reboot
•••展开全文
相关文章