https://github.com/zq2599/blog_demos
内容:所有原创文章分类汇总及配套源码,涉及Java、Docker、Kubernetes、DevOPS等;
台式机是2018年购买的惠普暗隐精灵3代,显卡GTX1060,本文记录了此机器安装Ubuntu 16.04.7 LTS,再安装Nvidia驱动的过程;
另外还有一些避坑的小结,如果您遇到了类似问题可以拿来参考;
先安装Ubuntu16 LTS桌面版
U盘安装,我这里是惠普台式机,启动时出现惠普LOGO的时候,多次点击F10,进入bios,启动顺序选择U盘启动,然后在页面指导下顺利安装Ubuntu系统
sudo apt-get install openssh-server
sudo service ssh start
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
sudo apt-get remove --purge nvidia*
sudo vi /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau options nouveau modeset=0
sudo update-initramfs -u
will@ubuntu-hp:~$ lsmod | grep nouveau nouveau 1712128 4 mxm_wmi 16384 1 nouveau i2c_algo_bit 16384 1 nouveau ttm 106496 1 nouveau drm_kms_helper 172032 1 nouveau drm 401408 7 drm_kms_helper,ttm,nouveau wmi 24576 4 hp_wmi,wmi_bmof,mxm_wmi,nouveau video 45056 1 nouveau
为了使刚才的配置生效,请立即重启电脑sudo reboot
重启后再次ssh登录,再执行命令lsmod | grep nouveau已经看不见内容了,证明刚才的配置已经生效;
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
ubuntu-drivers devices
sudo apt-get install nvidia-430 nvidia-settings nvidia-prime
sudo apt install nvidia-cuda-toolkit
will@ubuntu-hp:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2015 NVIDIA Corporation Built on Tue_Aug_11_14:27:32_CDT_2015 Cuda compilation tools, release 7.5, V7.5.17
will@ubuntu-hp:~$ nvidia-smi NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
sudo dkms install -m nvidia -v 430.64
此时在Ubuntu电脑上输入密码后,等待几秒钟又会回到输入密码的页面,始终无法登录
这是因为GRUP中设定的是使用集成显卡,而此时我们已经安装了Nvidia驱动,所以无法再用集成显卡驱动登录了,需要修改设定
此时ssh远程连接是正常的,先连上去,打开文件/etc/default/grub,找到GRUP_CMDLINE_LINUX_DEFAULT这一行,将值修改成下图红框的内容:
sudo apt-get install linux-source
sudo apt-get install linux-headers-4.4.0-210-generic
我是欣宸,期待与您一同畅游Java世界…
https://github.com/zq2599/blog_demos