Ubuntu18.04安装完应该做的一些事 显卡驱动安装和cuda8.0
博主装Ubuntu18.04主要是为了用于跑深度学习,所以我们先来搞搞gcc环境
第一步:安装多版本gcc、g++可切换
sudo apt-get install gcc-4.8 gcc-4.8-multilib
sudo apt-get install g++-4.8 g++-4.8-multilib
sudo apt-get install gcc- gcc--multilib
sudo apt-get install g++- g++--multilib
sudo apt-get install gcc- gcc--multilib
sudo apt-get install g++- g++--multilib
sudo apt-get install gcc- gcc--multilib
sudo apt-get install g++- g++--multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-
切换版本命令
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
根据自己想要的环境选择
第二步:准备安装显卡驱动和cuda8.0等相关文件
第三步:安装显卡驱动
- 1、开机 nomodeset 进入系统
- 开机进引导界面 第一项 按e 进入配置启动
- 在quiet splash - - -后加上 nomodeset
- 按F10 保存 进入系统
quiet splash - - -
quiet splash nomodeset
- 2、禁用系统自带NVIDIA驱动
sudo vim /etc/modprobe.d/blacklist.conf
# 在文件尾加入
blacklist nouveau
options nouveau modeset=
# 保存并退出 执行下面命令 更新引导
sudo update-initramfs –u
- 3、安装 NVIDIA 驱动
# 切换gcc 版本 到gcc- 以上 (使用高版本感觉会好一点)
# 查看支持的驱动版本
ubuntu-drivers devices
# 安装驱动
sudo ubuntu-drivers autoinstall
# 根据查询的版本安装比较保险 例如
sudo apt-get install nvidia-driver-
# 装驱动 需要关闭 安全启动
- 5、重启系统
sudo reboot
# 查看NVIDIA驱动 使用情况
nvidia-smi
- 6、安装cuda8.0
- 安装依赖
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
- 切换gcc版本到 4.8
sudo update-alternatives --config gcc
- 解压cuda8.0
sh cuda_8..61_375.26_linux.run --noexec --target
# 将runfile文件解压并且放到001文件夹中
# 将InstalUtil.pm 拷贝到 /etc/perl/
sudo cp InstalUtil.pm /etc/perl/- 安装cuda8.0及补丁
# 可选 加运行权限
chmod u+x cuda_8..61_375.26_linux.run
chmod u+x cuda_8.0.61.2_linux.run
# 运行
sudo ./chmod u+x cuda_8..61_375.26_linux.run Do you accept the previously read EULA?
accept/decline/quit: accept You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y Install NVIDIA Accelerated 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/deep ]: # 安装补丁
sudo ./cuda_8.0.61.2_linux.run- 添加环境变量
cd
vim .bashrc
# 添加到文件尾部
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64$LD_LIBRARY_PATH
# 保存 退出
sudo su
source .bashrc- 重启系统
sudo reboot
- 安装cudnn
sudo dpkg -i libcudnn7_7.1.4.-+cuda8.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.1.4.-+cuda8.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.1.4.-+cuda8.0_amd64.deb- 查看cuda版本和cudnn版本
# cuda 版本
cat /usr/local/cuda/version.txt
# cudnn 版本
cat /usr/include/x86_64-linux-gnu/cudnn_v7.h | grep CUDNN_MAJOR -A- 编译
# 不用编译全部 只编译deviceQuery
cd /home/deep/NVIDIA_CUDA-.0_Samples/1_Utilities/deviceQuery
make- 测试
./deviceQuery # 出现显卡信息
./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected CUDA Capable device(s) Device : "GeForce GTX 1080"
CUDA Driver Version / Runtime Version 9.1 / 8.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: MBytes ( bytes)
() Multiprocessors, () CUDA Cores/MP: CUDA Cores
GPU Max Clock rate: MHz (1.73 GHz)
Memory Clock rate: Mhz
Memory Bus Width: -bit
L2 Cache Size: bytes
Maximum Texture Dimension Size (x,y,z) 1D=(), 2D=(, ), 3D=(, , )
Maximum Layered 1D Texture Size, (num) layers 1D=(), layers
Maximum Layered 2D Texture Size, (num) layers 2D=(, ), layers
Total amount of constant memory: bytes
Total amount of shared memory per block: bytes
Total number of registers available per block:
Warp size:
Maximum number of threads per multiprocessor:
Maximum number of threads per block:
Max dimension size of a thread block (x,y,z): (, , )
Max dimension size of a grid size (x,y,z): (, , )
Maximum memory pitch: bytes
Texture alignment: bytes
Concurrent copy and kernel execution: Yes with copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: / /
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.1, CUDA Runtime Version = 8.0, NumDevs = , Device0 = GeForce GTX
Result = PASS
如果出现相应的显卡信息表示安装成功了。
Ubuntu18.04安装完应该做的一些事 显卡驱动安装和cuda8.0的更多相关文章
- Ubuntu18.04 NVIDIA显卡驱动 安装大全
离线安装NVIDIA显卡驱动 费了一天的劲,走了好多的坑,最主要的原因是gcc版本的问题,一定要用最新版本的gcc!!! 1)官网下载显卡驱动 2)apt 下载gcc包及其依赖包,可用apt-cach ...
- Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)
步骤 下载驱动 准备工作 进行安装 检查安装 下载驱动 首先我们需要去官网下载显卡驱动 打开浏览器,在百度搜索框中搜索:显卡驱动 下载 在手动搜索驱动程序一栏,根据自己的显卡进行选择 产品系列中,No ...
- ubuntu环境下,ubuntu16.04装机到nvdia显卡驱动安装、cuda8安装、cudnn安装
首先是安装ubuntu16.04 A.制作u盘启动盘(提前准备好.ios文件): 1.安装u盘制作工具unetbootinsudo apt-get install unetbootin2.格式化u盘s ...
- ubuntu显卡驱动安装及设置
转自: Ubuntu 14.04 Nvidia显卡驱动安装及设置 更换主板修复grub 引导后,无法从Nvidia进入系统(光标闪烁), 可能是显卡驱动出了问题. 1. 进入BIOS设置, 从集成 ...
- Ubuntu Intel显卡驱动安装 (Ubuntu 14.04--Ubuntu 16.10 + Intel® Graphics Update Tool)
最近使用在使用Ubuntu时,发现大部分情况下,不安装显卡驱动,使用默认驱动,都是没有问题的,但对于一些比较奇特配置的电脑,如下所示,如果使用默认驱动,会时常莫名其妙死机crash,尤其是在使用Ope ...
- archlinux-小米pro15_2020款使用archlinux(MX350显卡驱动安装)
1.官网下载archlinux ISO镜像 https://archlinux.org/download/ 使用磁力链接下载 2.使用软碟通将镜像写入U盘,制作成U盘启动盘 3.进入BIOS 关掉 ...
- GIT安装完需要做以下配置
安装完GIT后需要做以下配置: 一.找到git的安装目录,查找etc目录下的gitconfig配置文件,编辑此文件在最后一行添加如下内容: [gui] encoding = utf-8 [sv ...
- ubuntu14.04安装、NVIDIA显卡驱动安装及CUDA8.0、Cudnn5.1的环境搭建
安装环境:hp-Z440工作站.64位Ubuntu14.04(64位Ubuntu16.04).Cuda8.0.Cudnn5.1.Nvidia GeForce GT 705.Tesla K40c 本文可 ...
- 联想Y7000安装Ubuntu16.04/Win10双系统,wifi问题,显卡驱动和CUDA10安装
https://blog.csdn.net/la9881275/article/details/86720752 Ubuntu16.04系统安装拿到Ubuntu镜像制作装机优盘,这里就不写了.我的优盘 ...
随机推荐
- Linux系统搭建GitLab---阿里云Centos7搭建Gitlab踩坑
一.简介 GitLab,是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目安装. 它拥有与GitHub类似的功能,能 ...
- first-软件工程
第一部分:结缘计算机 1.你为什么选择计算机专业?你认为你的条件如何?和这些博主比呢?(必答) 之前高中班上男生特别喜欢软件这类的东西,每期电脑报都要买,我也会每期电脑报都会借来看,久而久之我就喜欢上 ...
- java操作svn【svnkit】实操
SVNKit中怎样使用不同的仓库访问协议? 当你下载了最新版的SVNKit二进制文件并且准备使用它时,一个问题出现了,要创建一个库需要做哪些初始化的步骤?直接与Subversion仓库交互已经在低级层 ...
- Android笔记——Socket通信实现简单聊天室
两部分,客户端和服务端 ---------------------------------------------------------------- 客户端 1.为防止ANR异常,互联网连接可用 ...
- 【Leetcode】【Medium】Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
- 【Leetcode】【Medium】Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice? For exampl ...
- 在IDE中集成boost
1. 获得Boost 进入Boost的网站(http://www.boost.org/) 下载boost_1_62_0.zip 2. 解压Boost 解压 boost_1_62_0.zip ,比如解压 ...
- Latex 参考文献引用
转:http://blog.sina.com.cn/s/blog_4b164557010143tl.html 导入 \usepackage[option]{natbib} 具体的 option 有 r ...
- c++ 读取文本问题
c++文本操作有以下三个方法 ifstream,ofstream,fstream 读取文本常用的方法如下 std::ifstream input; input.open(".log" ...
- ListView实现下拉刷新(一)建立头布局
一.效果演示 ListView实现下拉刷新,是很常见的功能.下面是一个模拟的效果,如下图: 效果说明:当往下拉ListView的时候 ...