本文将介绍如何在Ubuntu
系统上,安装显卡驱动。
打开上面的驱动下载链接,根据自己的显卡型号进行选择对应配置,如下图,后点击搜索。
驱动下载
搜索后,点击下面下载案例即可下载。
下载
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev
sudo 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 nouveau
options 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_PATH
export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
source ~/.bashrc
sudo apt-get --purge remove nvidia*
sudo apt autoremove
ctrl+alt+F1
(1-6均可),进入x-server
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
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有