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镜像制作装机优盘,这里就不写了.我的优盘 ...
随机推荐
- Vue入门基础(火柴)
前言 由于个人十分欣赏博友——小火柴的蓝色理想,他的博文我看了大多数,觉得十分的精彩,然而很多都是看后即忘.我想除了没有经常动手敲代码,更可能是在看的时候忽略了很多细节,因此打算把他的博文通通给“抄袭 ...
- 关于ios 10 的新的部分
编译器Xcode 8.2.1 SDK 10.2 1. 关于麦克风,相机,相册等部分的权限,需要在info.plist内进行设置,否则会出现crash.
- leetcode Ch1-search 2014
1. Search Insert Position class Solution { public: int searchInsert(int A[], int n, int target) { ,r ...
- pt-heartbeat(percona toolkit)
pt-heartbeat是用来监控主从延迟的一款percona工具,现在我们大部分的MySQL架构还是基于主从复制,例如MHA,MMM,keepalived等解决方案.而主从环境的话,我们很关心的就是 ...
- 【NLP_Stanford课堂】文本分类2
一.实验评估参数 实验数据本身可以分为是否属于某一个类(即correct和not correct),表示本身是否属于某一类别上,这是客观事实:又可以按照我们系统的输出是否属于某一个类(即selecte ...
- ajax 请求 服务器 响应内容过长 返回500错误的解决方法
在web.config试试加上 <system.web.extensions> <scripting> <webServices> <jsonSerializ ...
- lua的local问题
1. 初识 使用Local带来错误.自己写了一个递归的函数,结果报错: local fLocal = function(n) ) then return n; else ) end end )) 错误 ...
- FireFox浏览器Flash&视频下载工具推荐
介绍 两款扩展组件:Flash and Video Download & Flash Video Downloader 一起使用,各有优缺点. Flash and Video Download ...
- mongdb时间类型
Date() 显示当前的时间new Date 构建一个格林尼治时间 可以看到正好和Date()相差8小时,我们是+8时区,也就是时差相差8,所以+8小时就是系统当前时间ISODate() 也是格林 ...
- 关于mvvm:UI、数据、绑定、状态、中间变量、数据适配、数据处理
绑定: UI控件 --> VM VM -> UI控件 关于mvvm:UI.数据.绑定.状态.中间变量.数据适配.数据处理: https://github.com/zzf073/Log ...