首页 > 学院 > 开发设计 > 正文

caffe安装(1)ubuntu16.04+显卡驱动+cuda8.0

2019-11-14 11:12:14
字体:
来源:转载
供稿:网友

0. 安装Ubuntu16.04系统

F2进入BIOS, 设置U盘启动(原来已装了ubuntu的要取消快速启动) 按照提示安装ubuntu16.04想,选择英文版本,中午版本的路径一看就晕

安装完会发现分辨率不对,而且改不了,然而安装完显卡驱动就好啦,所以先不管

1.安装显卡驱动

上nividia官网下载相应版本 下载 后右击,修改属性为可执行文件

sudo service lightdm stop sudo ./NVIDIA-linux-x86_64-375.20.run 按照提示安装 sudo service lightdm restart

安装完看显卡是否安装成功,可以看到nvidia-settings为安装成功

nvidia-settings

查看nividia显卡信息: nvidia-smi

Sat Feb 4 14:11:46 2017 +-----------------------------------------------------------------------------+| NVIDIA-SMI 367.48 Driver Version: 367.48 ||-------------------------------+----------------------+----------------------+| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC || Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. ||===============================+======================+======================|| 0 TITAN X (Pascal) Off | 0000:02:00.0 On | N/A || 23% 24C P8 13W / 250W | 191MiB / 12186MiB | 2% Default |+-------------------------------+----------------------+----------------------++-----------------------------------------------------------------------------+| PRocesses: GPU Memory || GPU PID Type Process name Usage ||=============================================================================|| 0 4578 G /usr/lib/xorg/Xorg 148MiB || 0 5329 G compiz 41MiB |+-----------------------------------------------------------------------------+

2. 安装CUDA

2.1 下载:(https://developer.nvidia.com/cuda-downloads) 选择对应的版本 这里写图片描述 2.2 修改为可执行文件

sudo chmod +x cuda_8.0.44_linux.run

2.3 安装依赖库,这些是安装cuda-sample需要的

sudo apt-get install freeglut3-dev sudo apt-get install build-essential sudo apt-get installlibx11-dev sudo apt-get install libxmu-dev sudo apt-get install libxi-dev sudo apt-get installlibglu1-mesa-dev

2.4 执行

sudo ./cuda_8.0.44_linux.run一开始是说明,ctrl+c跳过那些文字,accept接受要求Do you accept the previously read EULA?accept/decline/quit: acceptInstall NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?(y)es/(n)o/(q)uit: nInstall the CUDA 8.0 Toolkit?(y)es/(n)o/(q)uit: yEnter 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: yInstall the CUDA 8.0 Samples?(y)es/(n)o/(q)uit: y Enter CUDA Samples Location [ default is /home/kinny ]:

一定要注意提示安不安装 NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48? 要选择不,我因为这个版本可能跟你自己的不一样,安装了重启后会进不去桌面

2.5 添加PATH路径,lib路径

sudo gedit /etc/profile添加export PATH=/usr/local/cuda-8.0/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

保存,执行source /etc/profile

2.6 验证安装成功 sudo reboot

cd ~/NVIDIA_CUDA-8.0_Samples makecd ~/NVIDIA_CUDA-8.0_Samples/bin/x86_64/linux/release./deviceQuery

显示 Result = PASS

3. 安装CuDNN

官网下载CuDNN,需要邮箱注册,填写信息

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

参考:Ubuntu 16.04安装配置TensorFlow GPU版本


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表