a. ubuntu 18.04默认安装了第三方开源的驱动程序nouveau,安装nvidia显卡驱动首先需要禁用nouveau,不然会碰到冲突的问题,导致无法安装nvidia显卡驱动。
编辑文件blacklist.conf
安装或使用vi
在文件最后部分插入以下两行内容
options nouveau modeset=0
更新系统
没有信息显示,说明nouveau已被禁用,接下来可以安装nvidia的显卡驱动。
2. 在英伟达的官网上查找你自己电脑的显卡型号然后下载相应的驱动。
3. 在ubuntu下按ctrl+alt+f6进入命令行界面,(进入命令行的方式可能有所不同,)
然后在命令行界面下输入:
然后卸载掉原有驱动:
4.
给驱动run文件赋予执行权限:
安装:
no-x-check:安装驱动时关闭X服务
-no-nouveau-check:安装驱动时禁用nouveau
-no-opengl-files:只安装驱动文件,不安装OpenGL文件
出现找不到cc文件的问题,要执行下面的语句,否则安装完成,建立软连接也无法找到cc文件
sudo apt-get install g++
sudo apt-get install make
The distribution-provided pre-install script failed! Are you sure you want to continue? 选择 yes 继续。
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later? 选择 No 继续。
问题没记住,选项是:install without signing
问题大概是:Nvidia’s 32-bit compatibility libraries? 选择 No 继续。
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. 选择 Yes 继续
这些选项如果选择错误可能会导致安装失败,没关系,只要前面不出错,多尝试几次就好。
挂载Nvidia驱动:
检查驱动是否安装成功: