赞
踩
sudo vim /etc/modprobe.d/blacklist.conf
在最后添加:
blacklist nouveau
options nouveau modeset=0
sudo update-initramfs -u
然后重启,输入:
lsmod | grep nouveau
查看nouveau是否已禁用
如果什么都没有返回 表示已经禁用了
此时进行下一步
官网地址:https://www.nvidia.cn/Download/index.aspx?lang=cn
像我这样直输入查找下载就好,很快的
记住下载位置 最好保存到家目录
安装前先确认系统已经安装好了gcc和cmake。
命令行输关闭图形化界面:
su root
service lightdm stop //如果这句不行的可以试试 sudo telinit 3
卸载原驱动:
apt-get remove nvidia-*
给权限:
chmod a+x NVIDIA-Linux-x86_64-418.43.run
执行安装:
sudo ./NVIDIA-Linux-x86_64-418.43.run -no-x-check -no-nouveau-check -no-opengl-files
-no-x-check:安装驱动时关闭X服务
-no-nouveau-check:安装驱动时禁用nouveau
-no-opengl-files:只安装驱动文件,不安装OpenGL文件,注意台式机不要跟这参数
注意:对于台式机,使用NVIDIA独立显卡,直接默认安装,不需要加任何选项。如果加上–no-opengl-files以后,会导致开机进入系统仍然使用nouveau驱动,在系统信息里面是显示Gallium 0.4 on lvmpipe(LLVM 3.8, 128bits)。 而普通笔记本一般默认采用集显作为视频输出,不添加–no-opengl-files选项,易导致输入密码时循环进入登录页面,无法进入桌面。
再注:
如果安装时报错:An NVIDIA kernel module ‘nvidia-drm‘ appears to already be load…lua ERROR: An NVIDIA kernel module 'nvidia-drm' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.
解决办法:需要设置启动 Ubuntu 系统时不让系统加载图形化界面,直接进入tty:
sudo systemctl set-default multi-user.target
sudo reboot
等待 NVIDIA 驱动安装完成并测试显卡正常识别和运行后,再在终端执行如下两条命令设置系统默认进入图形化界面模式:
sudo systemctl set-default graphical.target
sudo reboot
再再注:
遇到“There apperas to already be a driver installed…?"选择continue installation。
遇到”INSTALL Nvidia’s 32-bit compatibility libraries?“ 选择 yes 继续。
遇到”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? Any pre-existing x confile will be backed up. “选择 no
执行完成,挂载Nvidia驱动:
modprobe nvidia
检查驱动是否安装成功:
nvidia-smi
如果出现如下提示,则说明安装成功:
安装完用了很久也一直没有问题,但是始终觉得我这样的配置运行rviz不应该很卡,后面查了一下可能还是显卡驱动的问题,于是乎:
nvidia-smi
显示no progress
nvidia-settings
无Prime profiles选项
重点:如果存在这些问题,如果你是台式机:
在运行.run文件时,不应该加参数 --no-opengl-files,即应该:
sudo ./NVIDIA-Linux-x86_64-***.run --dkms
安装完后的效果应该是这样的!
https://blog.csdn.net/chekongfu/article/details/90758638
https://blog.csdn.net/Wenyue_Wang/article/details/104541687
https://blog.csdn.net/qq_40115871/article/details/106167245
https://blog.csdn.net/u014561933/article/details/79958017#t3
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。