写在前面
换成Ubuntu系统后,系统默认安装的是X org提供的开源驱动nouveau,这个驱动可以胜任2D图形加速任务,但对3D图形处理就无能为力了。因此,在启动VMWare虚拟机的时候就经常报形如 “No 3D support is aviable from host”, "Hardware graphics acceleration is not aviliable"之类的错误。网上的教程林林总总,但实际上换驱动的方法并没有有些教程里说的那么复杂。现总结如下,以备后用。
一、硬件说明
- 电脑:DELL-Inspiron-7472
- 独立显卡型号:NVIDIA-GeForce-MX150
- 系统:Ubuntu-18.04 LTS
二、安装过程
-
禁用BIOS中的Security Boot选项。方法:开机时按F12,进入BIOS界面,并在Security Boot那项中勾选Disable Security Boot
-
禁用系统自带的nouveau显卡驱动。方法:
sudo -s # 提升至root权限 cd /etc/modprobe.d vim blacklist.conf #不会用vim的用gedit也可以,把命令里的vim换成gedit就行
然后在
blacklist.conf
文件末尾加上下面两行:blacklist nouveau options nouveau modeset=0
保存并退出,然后执行命令:
update-initramfs -u
重启系统,并在终端中输入lsmod | grep nouveau
,若无输出则说明禁用成功 -
安装NVIDIA自己的驱动
- 在软件与更新中转到附加驱动那个窗口(如下图所示)
- 勾选“使用NVIDIA driver metapackage 来自nvidia-driver-430”(390也可以,建议不要勾选test的那个,因为有可能不稳定)
- 点击“应用更改”,重启系统即可
- 在软件与更新中转到附加驱动那个窗口(如下图所示)
-
重启系统后,打开终端,输入
nvidia-smi
,如下图所示即为成功
写在后面
想装cuDNN的同学建议先去NVIDIA的官网传送门上面查一下自己电脑GPU的compute capability,cuDNN要求GPU compute capability3.0及以上。原文如下:
Ensure you meet the following requirements before you install cuDNN.
- A GPU of compute capability 3.0 or higher. To understand the compute capability of the GPU on your system, see: CUDA GPUs.
- For the latest compatibility software versions of the OS, CUDA, the CUDA driver, and the NVIDIA hardware, see the cuDNN Support Matrix.
我的电脑就是因为显卡太渣才被实力劝退的…MX150不配拥有姓名TAT