本文将介绍如何在Ubuntu系统上,安装显卡驱动。
打开上面的驱动下载链接,根据自己的显卡型号进行选择对应配置,如下图,后点击搜索。
驱动下载
搜索后,点击下面下载案例即可下载。
下载
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compilersudo apt-get install --no-install-recommends libboost-all-devsudo apt-get install libopenblas-dev liblapack-dev libatlas-base-devsudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
如果安装失败,则先进行pip3的升级更新,再重复上述操作。
sudo apt-get install python3-pip
sudo pip3 install --upgrade pip
sudo gedit /etc/modprobe.d/blacklist.conf# 在文件末尾写入blacklist nouveauoptions nouveau modeset=0# 保存后手动更新;sudo update-initramfs -u# 电脑重启,输入下列指令进行确认,若无输出,则禁用成功:lsmod | grep nouveau
sudo gedit ~/.bashrc
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATHexport LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
source ~/.bashrc
sudo apt-get --purge remove nvidia*sudo apt autoremove
sudo service lightdm stop
则需要安装LightDm:
sudo apt install lightdm
安装完毕后跳出一个界面,选择lightdm,再sudo service lightdm stop。
sudo chmod +x NVIDIA-……………….run*sudo sh NVIDIA-……………….run* --no-opengl-files --no-x-check --no-nouveau-check# –no-opengl-files 不安装OpenGL文件# –no-x-check 安装驱动时不检查X服务,非必需。# –no-nouveau-check 安装驱动时不检查nouveau,此参数非必需,因为之前已经手动禁用了nouveau。
安装过程中选项如下:
1.The distribution-provided pre-install script failed! Are you sure you want to continue?“Yes”2.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”3.Nvidia’s 32-bit compatibility libraries?“No”4.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”
modprobe nvidia
sudo service lightdm start #回到图形界面sudo reboot now #重启
sudo nvidia-smi
[1]驱动下载: https://www.nvidia.cn/Download/index.aspx?lang=cn
本文由梁桂钊于2023-08-20发表在梁桂钊的博客,如有疑问,请联系我们。
本文链接:https://720ui.com/8047.html