cuda-8.0安装
(这两天不小心把原来的显卡驱动搞崩,挣扎了好久,只好重新走一遍)
cuda 安装条件
gcc5.3.0(版本不能太高)
sudo apt-get install build-essential

tar -zxvf gcc-5.3.0.tar.gz
cd gcc-5.3.0
./contrib/download_prerequisites //下载依赖项
cd ..
mkdir /opt/gcc-build-5.3.0 //建立编译输出目录
cd gcc-build-5.3.0
(解压后的目录)/gcc-5.3.0/configure –enable-checking=release –enable-languages=c,c++ –disable-multilib //
make
make install
(一个小时或大半个小时后…)
检查安装版本:
gcc –version

cuda官网上下载相应版本后

禁止nouveau服务,将其加入后名单
vi /etc/modprobe.d/blacklist-nouveau.conf
添加
blacklist nouveau
options nouveau modeset=0
sudo update-initramfs –u

Ctrl+Alt+F1进入字符操作页面:关掉图形操作页面(X 服务)
sudo service lightdm stop
sudo sh ./cuda_8.0.61_375.26_linux-run.run
出现说明之后,按Ctrl + C键跳过
accept
可能第二项选no
其他可以根据需要自定义安装路径,或者默认回车
Reboot
检查是否安装cuda成功
cd NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
cuda-8.0安装心得

安装成功

Q1: 在字符操作页面(ctrl+alt+F1) sudo service lightdm stop 出现黑屏
通过远程终端执行cuda的.run 报错
Installing the NVIDIA display driver… The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly. If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.
cuda-8.0安装心得

A1:
sudo apt install dkms
sudo ./cuda_8.0.61_375.26_linux.run

Q2:
Ubuntu出现循环登录问题,无法登入桌面问题
A2:显卡驱动出现问题,需要重装,
清空之前的显卡驱动信息:
sudo apt-get –purgeremove nvidia*
Ctrl+Alt+F1进入字符操作页面:关掉图形操作页面(X 服务)
sudo service lightdm stop
开始重装显卡驱动:
(1)sudo apt-get install nvidia-XXX 驱动版本 
(2)最好安装官网上最新的适合的驱动
sudo sh ./NVIDIA-Linux….xxxx.run
sudo reboot

Q3:
可能出现安装完cuda之后,显卡驱动会出现问题,出现分辨率降低或者其他问题
A3:重新安装显卡驱动,但是千万不要sudo apt-get –purgeremove nvidia*
Ctrl+Alt+F1进入字符操作页面:关掉图形操作页面(X 服务)
sudo service lightdm stop
直接重新安装之前下载好的显卡驱动就好
sudo sh ./NVIDIA-Linux….xxxx.run
sudo reboot

Q4:装显卡驱动时候出现
Failed to start Load Kernel Modules 解决方法
A4:网上的解决方案
apt-get update

dpkg –configure -a

apt-get dist-upgrade

apt-get -f install

reboot
可以多次尝试,没有特别的顺序
在我这里不好使,几十次尝试终失败,
最后选择重装系统了

大战了两天多,其中遇到的问题,都没有做笔记,毕竟没有奏效,也罢。

相关文章:

  • 2021-10-01
  • 2021-11-08
  • 2021-12-08
  • 2021-10-29
  • 2021-04-10
  • 2022-12-23
  • 2021-11-13
  • 2021-07-17
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2021-05-07
  • 2021-07-07
  • 2022-12-23
  • 2021-11-16
相关资源
相似解决方案