当前位置:   article > 正文

深度学习环境的搭建_abort installation

abort installation

三大基础组件

GPU-英伟达驱动 , cuda,cudnn 的安装

版本的确定

首先看gpu的版本
直接安装gpu显卡可以支持的最高版本的驱动。高版本的驱动可以兼容低版本的cuda.
查看显卡版本 参考链接
https://blog.csdn.net/distant1219/article/details/118370133

lspci -vnn | grep VGA
lspci | grep -i nvidia
  • 1
  • 2

在这里插入图片描述
根据图中红框里的代码(四位数字),可以在搜索引擎上查询一下,即可得知显卡型号。
参考网址http://pci-ids.ucw.cz/mods/PC/10de?action=help?help=pci
运行ubuntu-drivers devices

在这里插入图片描述
如果不行,先执行

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
  • 1
  • 2

选择后面带着recommond 的那个版本的驱动。

安装方法

英伟达驱动的安装

**特别说明:**如果你后面还要装cuda,那么这一步就不是必须的,因为cuda安装包里是有驱动的。我原来没太注意,总是会多走这一步。不过,不论你是用这里安装driver,还是采用cuda中的driver,后面那个Nouveau都必须卸载掉,不然总会有些莫名其妙的问题。

驱动下载链接
https://www.nvidia.com/Download/index.aspx?lang=en-us

 sudo sh NVIDIA-Linux-x86_64-440.100.run
  • 1

卸载Nouveau

#---open a terminal---
sudo apt-get remove nvidia*
sudo apt autoremove
sudo apt-get install dkms build-essential linux-headers-generic
 
sudo vim /etc/modprobe.d/blacklist.conf
#---save the following info into file blacklist.conf---
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
#---end of the info saved----
 
#---go back to the terminal---
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
reboot
————————————————
参考链接:https://blog.csdn.net/tanmx219/java/article/details/86553485
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

可能存在的问题

 The distribution-provided pre-install script failed!  Are you sure you want
  to continue?                                                                 
       
                 Continue installation      Abort installation       

----> Continue installation

Would you like to register the kernel module sources with DKMS? This will    
  allow DKMS to automatically build a new module, if you install a different   
  kernel later.

                          Yes                       No  
---->No

 The CC version check failed:

  The kernel was built with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1), 
  but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.  

  This may lead to subtle problems; if you are not certain whether the         
  mismatched compiler will be compatible with your kernel, you may wish to     
  abort installation, set the CC environment variable to the name of the       
  compiler used to compile your kernel, and restart installation.

                Ignore CC version check     Abort installation         

----> select ignore

 WARNING: Ignoring CC version mismatch:

           The kernel was built with gcc version 7.4.0 (Ubuntu
           7.4.0-1ubuntu1~18.04.1), but the current compiler version is cc     
           (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.

                                       OK  
----> OK

Install NVIDIA's 32-bit compatibility libraries?
                                                                               
                          Yes                       No   
----> No

 An incomplete installation of libglvnd was found. All of the essential       
  libglvnd libraries are present, but one or more optional components are      
  missing. Do you want to install a full copy of libglvnd? This will overwrite 
  any existing libglvnd libraries.

      Don't install  Install and overw          Abort installation.       

---->Install and overw

Would you like to run the nvidia-xconfig utility to automatically update
  your X configuration file so that the NVIDIA X driver will be used when you
  restart X?  Any pre-existing X configuration file will be backed up.         
                                                                      
                          Yes                       No                 
                          
---->Yes

Your X configuration file has been successfully updated.  Installation of    
  the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 440.100)   
  is now complete.

                                       OK  
----> OK
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65

检查安装成功与否

 nvidia-smi
  • 1
查看驱动版本

sudo dpkg --list | grep nvidia-*

第一步,打开终端,先用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.
  • 1
  • 2

第二步,使用nvcc -V检查驱动和cuda。

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
  • 1
  • 2
  • 3
  • 4

发现驱动是存在的,于是进行下一步

第三步,查看已安装驱动的版本信息

ls /usr/src | grep nvidia
  • 1

比如我的驱动版本是:nvidia-450.57

第四步,依次输入以下命令

sudo apt-get install dkms

sudo dkms install -m nvidia -v 450.57
  • 1
  • 2
  • 3

等待安装完成后,再次输入nvidia-smi

cuda的安装

sudo chmod a+x cuda_10.0.130_410.48_linux.run
sudo ./cuda_10.0.130_410.48_linux.run --no-opengl-libs
  • 1
  • 2

问题1:
出现报错

cudnn的安装

学习架构

pytorch

tensorflow

darknet

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/647421
推荐阅读
相关标签
  

闽ICP备14008679号