Ubuntu 16.04安装GPU(GTX1080 Ti)
来源:互联网 发布:在淘宝上买书需要什么 编辑:程序博客网 时间:2024/06/13 21:15
一、安装ubuntu 16.04
1.ISOUltra 制作启动盘
2.安装ubuntu 16.04系统
3.用VPN上网
https://jingyan.baidu.com/article/ca41422fecac111eae99eddf.html
(Linux Ubuntu系统中设置VPN完整教程)
4.安装JDK(配置环境变量)
二、安装NVIDIA显卡
1.输入命令 init 3进入文本模式
2.切换到tty1控制台:Ctrl+Alt+F1
3.关闭X-Window:sudoservice lightdm stop
4.开始安装:sudo ./NVIDIA.run
5.重新启动X-Window:sudoservice lightdm start(不行的话,按Ctrl+Alt+F7进入图形界面)
6.安装后驱动程序工作不正常,使用下面的命令进行卸载:sudo sh~/NVIDIA-Linux-x86_64-367.44.run --uninstall
7.验证安装成功:nvidia-smi 或者nvidia-settings
三、安装CUDA 8.0
1.gcc 从5.X 降到 4.9 (ubuntu12.04 默认的gcc版本都是5.x 以上的,但CUDA8.0不支持)
sudo add-apt-repositoryppa:ubuntu-toolchain-r/test
sudo apt-get update
apt-get install gcc-4.9 g++-4.9
we can fixit with simple symbolic
cd /usr/bin
rm gcc g++ cpp
ln -s gcc-4.9 gcc
ln -s g++-4.9 g++
ln -s cpp-4.9 cpp
https://askubuntu.com/questions/428198/getting-installing-gcc-g-4-9-on-ubuntu
2.开始安装CUDA
sudo sh cuda_8.0.27_linux.run
报错:缺少包
Installingthe CUDA Toolkit in /usr/local/cuda-8.0 …
Missingrecommended library: libGLU.so
Missingrecommended library: libX11.so
Missingrecommended library: libXi.so
Missingrecommended library: libXmu.so
原因是缺少相关的依赖库,安装相应库就解决了:
sudoapt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-devlibgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
再次安装,就不再提示了
sudo sh cuda_8.0.27_linux.run
注意:提示安装驱动时候,一定要点 NO!NO!NO!
===========
Do you accept the previously read EULA?
accept/decline/quit: accept
Install NVIDIAAccelerated Graphics Driver for Linux-x86_64 375.26?
(y)es/(n)o/(q)uit: n
Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y
Enter Toolkit Location
[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location
[ default is /home/guyadong ]:
Installing the CUDA Toolkit in /usr/local/cuda-8.0 …
Installing the CUDA Samples in /home/guyadong …
Copying samples to /home/guyadong/NVIDIA_CUDA-8.0_Samplesnow…
Finished copying samples.
===========
3.安装成功,环境变量配置
=Summary =
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/guyadong
Please make sure that
- PATH includes /usr/local/cuda-8.0/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 notinstall the CUDA Driver. A driver of version at least 361.00 is required forCUDA 8.0 functionality to work.
To install the driver using this installer, run the followingcommand, replacing with the name of this run file:
sudo .run -silent -driver
Logfile is /tmp/cuda_install_13101.log
Signal caught, cleaning up
我们在terminal中键入下列命令:
sudo gedit~/.bash_profile # 打开.bash_profile 这是用户的环境变量,不是全局的
然后在打开的文本末尾加入:
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
保存并关闭后,输入下列命令使环境变量生效:
source~/.bash_profile # 使被更改的环境变量生效
然后设置环境变量和动态链接库,在命令行输入:
$ sudo gedit /etc/profile
在打开的文件末尾加入:
export PATH = /usr/local/cuda/bin:$PATH
保存之后,创建链接文件:
sudo gedit /etc/ld.so.conf.d/cuda.conf
在打开的文件中添加如下语句:
/usr/local/cuda/lib64 1 1
然后执行
sudo ldconfig (使链接立即生效)
4.测试安装成功
cd/usr/local/cuda-8.0/samples/1_Utilities/deviceQuery
进入NVIDIA_CUDA-8.0_Samples目录,执行:make
sudo./deviceQuery
执行:$ nvcc-V,结果如下:
四、安装cudnn 5.1
1、下载后解压
tar -zxvf ~/Download/cudnn.gz
2.进入解压后的cudnn的cuda目录
sudo cp cudnn.h /usr/local/cuda/include/ #复制头文件
sudo chmod a+r/usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* #赋权限
再将cd进入lib64目录下的动态文件进行复制和链接:
sudo cp lib*/usr/local/cuda/lib64/ #复制动态链接库
cd /usr/local/cuda/lib64/
sudo rm -rf libcudnn.so libcudnn.so.5 #删除原有动态文件
sudo ln -s libcudnn.so.5.0.5libcudnn.so.5 #生成软衔接
sudo ln -s libcudnn.so.5libcudnn.so #生成软衔接
后面IDE出现错误:libcudnn.so.6.5:cannot open shared object file:Nosuche file or directory
解决: sudoldconfig -v (使链接立即生效)
五、安装Pycharm和anaconda(python)
1.Pycharm
解压后进入bin目录,运行./pycharm.sh 即可
2.anaconda 安装
bashanaconda.sh
中间有一步问是否添加环境变量,回答 YES!YES!YES!
source ~/.bashrc #更新环境变量
六、安装tensorflow_gpu和keras
1.从清华大学镜像软件站下载
https://mirrors.tuna.tsinghua.edu.cn/help/tensorflow/
2.pip 安装 keras
- Ubuntu 16.04安装GPU(GTX1080 Ti)
- Ubuntu 16.04 Tensorflow-gpu 1.4.1+GTX1080 +pycharm 环境搭建(附高清无码大图)
- ubuntu(gtx1080)安装caffe
- ubuntu 16.04 + GTX1080 + caffe
- Caffe安装要点:Ubuntu 16.04+双GTX1080+Opencv3.3+Anaconda3
- Ubuntu 16.04 + Opencv3.0 + gtx1080
- tensorflow GPU (1080ti) + win10安装笔记
- ubuntu 14.04 安装gtx1080 显卡驱动
- Ubuntu16.04.3 + GTX1080 ti 安装流程,以及可能出现的问题
- Ubuntu 16.04下安装Tensorflow(GPU)
- Ubuntu 16.04安装配置TensorFlow GPU版本
- Ubuntu 16.04 安装 Tensorflow(GPU支持)
- Ubuntu 16.04 LTS 安装Theano配置GPU
- ubuntu 16.04 安装TensorFlow GPU版本
- Ubuntu 16.04安装和配置TensorFlow-gpu
- Ubuntu 16.04 安装 TensorFlow(GPU支持)
- ubuntu 16.04 安装Tensorflow(CPU和GPU)
- ubuntu 16.04 x64如何安装mxnet GPU
- 笔试题6——数组中2个出现一次的数(其他2次)
- 切换夜间模式
- android webview loadurl弹出系统浏览器问题
- HDU-3333:Turing Tree(莫队算法+线段树或树状数组+map或离散化)
- 计划
- Ubuntu 16.04安装GPU(GTX1080 Ti)
- HTML5canvas绘制火柴人
- Unity_飘伤害_053
- H5调用摄像头、相册、拨打电话、信息
- SEO与SEM的好处和区别
- 正则匹配
- QT5.6 开发笔记
- 洛谷3372 线段树1
- Qt学习笔记之QTextEdit 、QPlainTextEdit