系统按照安装(二):Ubuntu16.04 + RTX 2080Ti + cuda 10.1 + cudnn 7.5 + pytorch 1.0

Ubuntu16.04 + RTX 2080Ti + cuda 10.1 + cudnn 7.5

一、安装显卡驱动

对应的版本是418.43

sudo service lightdm stop

ctl+ait+f1

./NVIDIA-Linux-x86_64-418.43 --no-opengl-files

sudo service lightdm start

二、安装Python3.5.1

1. 先去官网下载安装包或终端下载

wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

2. 解压文件

tar -zvxf Python-3.5.1

3. 进入Python3.5.1下配置

cd Python-3.5.1

./configure –prefix=/usr/python3 #安装目录在/usr/python3

make & make install

4. 更改默认Python(不建议,因可能需要安装caffe)

三、安装搜狗输入法

官网下载对应版本

https://pinyin.sogou.com/linux/

1. 首先需要到system setting 中讲Language Support 中的“Keyboard input method system”设置成fcitx;

sudo apt-get install gdebi gdebi-core

sudo apt-get install -f

2. cd Downloads #(该文件下载至的地址)

sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb #解压该文件

3. 注销账户,重新登录,屏幕右上角出现键盘标志,点击“设置”,在新窗口的左下角将“根据当前语言选择”勾选“取消”,点击加号,选择“sogou pinyin”选项,即可成功添加搜狗输入法;

4. 进入all setting 的text entry 添加 sogou pinyin (fcitx)

四、安装pycharm

1. 去官网下载社区版本的pycharm

https://www.jetbrains.com/pycharm/download/#section=linux

点击右键,再点extract here

2.安装文件

cd Downloads

cd pycharm-community-2018.3.5

cd bin

3. 运行以下命令解压文件

sh ./pycharm.sh

这样就会出现pycharm的图形界面

4. 再次进入pycharm

cd ~

sh pycharm &

五、安装cuda

首先也是去下载https://developer.nvidia.com/cuda-toolkit-archive,可以自己注册一个账号。 

一定要选择runfile.下载完成之后,执行

sudo sh cuda_8.0.61_375.26_linux.run --override

然后就进入安装过程,开始都是End User License Agreement,你可以CTRL +C 跳过,然后accept,下面就是安装的交互界面,开始的Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?选择n,因为你已经安装驱动了。

Using more to view the EULA.

End User License Agreement

--------------------------

Preface

-------

The following contains specific license terms and conditions

for four separate NVIDIA products. By accepting this

agreement, you agree to comply with all the terms and

conditions applicable to the specific product(s) included

herein.

NVIDIA CUDA Toolkit

Description

The NVIDIA CUDA Toolkit provides command-line and graphical

tools for building, debugging and optimizing the performance

of applications accelerated by NVIDIA GPUs, runtime and math

libraries, and documentation including programming guides,

user manuals, and API references. The NVIDIA CUDA Toolkit

License Agreement is available in Chapter 1.

Default Install Location of CUDA Toolkit

Windows platform:

Do you accept the previously read EULA?

accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?

(y)es/(n)o/(q)uit: n

Install the CUDA 10.1 Toolkit?

(y)es/(n)o/(q)uit: y

Enter Toolkit Location

[ default is /usr/local/cuda-10.1 ]:

Do you want to install a symbolic link at /usr/local/cuda?

(y)es/(n)o/(q)uit: y

Install the CUDA 10.1 Samples?

(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location

[ default is /home/kinny ]:

Installing the CUDA Toolkit in /usr/local/cuda-10.1 ...

Missing recommended library: libXmu.so

Installing the CUDA Samples in /home/kinny ...

Copying samples to /home/kinny/NVIDIA_CUDA-10.1_Samples now...

Finished copying samples.

===========

= Summary =

===========

Driver: Not Selected

Toolkit: Installed in /usr/local/cuda-10.1

Samples: Installed in /home/kinny, but missing recommended libraries

Please make sure that

- PATH includes /usr/local/cuda-10.1/bin

- LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/doc/pdf for detailed information on setting up CUDA.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work.

To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:

sudo <CudaInstaller>.run -silent -driver

Logfile is /tmp/cuda_install_17494.log

配置cuda环境变量

https://blog.csdn.net/autocyz/article/details/52299889

测试cuda是否安装成功

cd /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery

make

sudo ./deviceQuery

如果显示的是一些关于GPU的信息,则说明安装成功了。

nvidia-smi

若看到类似以下信息则说明 cuda 已安装成功:

安装cudnn7.5.1

1.在官网下载

https://developer.nvidia.com/rdp/cudnn-download

进入配置cuda 10

要下载四个文件

cuDNN Library for Linux(Power)

cuDNN Runtime Library for Ubuntu16.04 (Deb)

cuDNN Developer Library for Ubuntu16.04 (Deb)

cuDNN Code Samples and User Guide for Ubuntu16.04 (Deb)

2. 进入到文件下载目录里,比如Downloads

在终端输入 (一定要按照顺序安装不然会出错)

tar -xzvf cudnn-10.1-linux-ppc64le-v7.5.0.56.tgz

cd Downloads

sudo cp cuda/targets/ppc64le-linux/include/cudnn.h /usr/local/cuda/include

sudo cp cuda/targets/ppc64le-linux/lib/libcudnn* /usr/local/cuda/lib64

sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

3. 安装其余的包

sudo dpkg -i libcudnn7_7.3.1.20-1+cuda10.0_amd64.deb

sudo dpkg -i libcudnn7-dev_7.3.1.20-1+cuda10.0_amd64.deb

sudo dpkg -i libcudnn7-doc_7.3.1.20-1+cuda10.0_amd64.deb

4. 验证cudnn 是否安装成功

cp -r /usr/src/cudnn_samples_v7/ $HOME

cd $HOME/cudnn_samples_v7/mnistCUDNN

make clean && make

./mnistCUDNN

 

使用pip3 出现以下错误:

Traceback (most recent call last):
File “/usr/bin/pip3”, line 9, in
from pip import main


或者pip 时也出现这个问题
这是pip 10.0.0版本的BUG

注:现在这个问题好像已经解决了

解决办法

修改 /usr/bin/pip 文件

from pip import main

if __name__ == '__main__':

sys.exit(main())

改为:

from pip import __main__
if __name__ == '__main__sys.exit(__main__._main())

另一种问题

Traceback (most recent call las

File "/usr/bin/pip3", line 11, in

sys.exit(main())

File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main

locale.setlocale(locale.LC_ALL, ''

File "/usr/lib/python3.5/locale.py", line 594, in setlocale

return _setlocale(category, locale)

locale.Error: unsupported locale setting

解决方法

在 Linux 终端输入以下命令,即可

export LC_ALL=C

更改pip镜像源

pip install pip -U

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

ubuntu 把软件源修改为国内源和更新

1. 备份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup cp /etc/apt/sources.list /etc/apt/sources.list.backup

2. 修改文件并添加国内源

vi /etc/apt/sources.list /etc/apt/sources.list

3. 注释原文件内的源并添加如下地址

#Ubuntu 官方源 
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

#或者这些源

#阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

#网易163
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

#网易163
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

4. 放置非官方源的包不完整,可在为不添加官方源

deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse//archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse

5. 更新源

sudo apt-get update apt-get update

6. 更新软件

sudo apt-get dist-upgrade
sudo apt-get upgrade apt-get dist-upgrade
sudo apt-get upgrade

由于包与包之间存在各种依赖关系。upgrade只是简单的更新包,不管这些依赖,它不和添加包,或是删除包。而dist-upgrade可以根据依赖关系的变化,添加包,删除包。upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来. dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,就会试着去安装/移除它. (所以通常这个会被认为是有点风险的升级) 

7. 常见的修复安装命令

sudo apt-get -f install apt-get -f install

 

 

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值