闲话少说,先描述一下电脑的情况:宏基笔记本,双显卡,linux下默认为核显(巨坑1),安装ubuntu16.04和win10双系统

1.安装nvidia driver
首先检查你的NVIDIA VGA card model
sudo lshw -numeric -C display可以看到你的显卡信息

借用网上的一张图表述一下

值得注意的在这张图里,他的默认GPU就是Nividia的显卡,而一般系统默认的会是Intel的集成显卡
​待会会介绍如何解决这个问题

首先我们需要查看自己的显卡能否安装CUDA,也就是说自己的显卡性能够不够
https://developer.nvidia.com/cuda-gpus这是英伟达的性能信息页面,选择你的显卡系列然后点进去,如果性能分>=3.0那么就可以继续安装,否则老兄你还是攒钱买一台新的吧

如果可以用我们使用这个命令查看你可以使用的驱动:
ubuntu-drivers devices
或者在http://www.nvidia.com/Download/index.aspx输入型号查看驱动
然后使用sudo apt-get install nvidia-xxx(你的显卡驱动型号)下载驱动

没有集显的朋友们,你的第一步就可以结束而像我一样的悲催党,征程才刚刚开始

我们需要切换Intel和Nvidia显卡

参见这篇文章https://www.linuxdashen.com/switch-intel-nvidia-graphics-card-ubuntu
按照文章操作即可,若果操作成功,那么你的第一步也到此为止了
如果你点比较背,没有

这说明X-server的配置出了问题,不过我们也不需要怎么折腾,
直接采用prime-select nvidia就可以了
然后输入rebot(重启)你的电脑
重启过后应该会多一个选项 change secure boot options,按照提示输入密码(应该让你输入密码中的几位)关闭安全模式,然后就可以了

​安装Cuda
从这个页面下载Cuda8.0
https://developer.nvidia.com/cuda-80-ga2-download-archive(注意一定要是8.0)
一定要选择runfile.下载完成之后,执行
sudo sh cuda_8.0.44_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 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/kinny ]:

Installing the CUDA Toolkit in /usr/local/cuda-8.0 …
Missing recommended library: libXmu.so

Installing the CUDA Samples in /home/kinny …
Copying samples to /home/kinny/NVIDIA_CUDA-8.0_Samples now…
Finished copying samples.

===========

= Summary =

Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/kinny, but missing recommended libraries

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 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 with the name of this run file:
sudo .run -silent -driver

Logfile is /tmp/cuda_install_17494.log
配置cuda环境变量
export PATH=”$PATH:/usr/local/cuda-8.0/bin”
export LD_LIBRARY_PATH=”/usr/local/cuda-8.0/lib64”
nvidia-smi

结果出现以下输出,说明配置成功

​安装CuDnn

到这里下载https://developer.nvidia.com/rdp/cudnn-download

一定要下载DNN5.1版本
选择 Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0下载
cuDNN v5.1 Runtime Library for Ubuntu16.04 Power8 (Deb)
安装
或者下载tar,解压后会得到一个Cuda文件夹,复制到Cuda-8.0文件夹中
sudo cp cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda-8.0/lib64/libcudnn*

​安装Tnesorflow-GPU
这时候如果我们直接pip install tensorflow-gpu的话汇报一大堆错误,这因为虽然官网上的教程是安装cuDnn5.1的,但是实际上
1.3版本及以上的tensorflow用的是CuDNN6.0

so
pip install tensorflow-gpu==1.2
搞定!

笔记本安装tensorflow全攻略相关推荐

  1. Longhorn安装使用全攻略(下)(转)

    Longhorn安装使用全攻略(下)(转)[@more@] 微软Windows图形和游戏负责人Lester,在接受Gamespot访问的时候表示,微软下一代操作系统Longhorn将原生支持XNA开发 ...

  2. IBM T60/X60安装操作系统全攻略

    1.bios设置.这一步是针对T60/X60的.开机按f1进入bios,进入configuration,然后在SATA里面将SATA的模式设置成compatibility(兼容模式),默认的是AHCI ...

  3. 树莓派安装RetroPie全攻略

    树莓派安装RetroPie全攻略 前言: RetroPie可以将树莓派变成一台复古游戏机. Retropie是一款运行于Raspbian系统之上的app,安装方式可以是在现有的系统环境中安装Retro ...

  4. Vysor安装使用全攻略

    为什么80%的码农都做不了架构师?>>>    Vysor安装使用全攻略 Vysor 是一款可以免费让你在电脑上控制 Android 手机/平板的软件!它实用性超高,不仅可以将安卓手 ...

  5. mysql中phpmyadmin安装教程_phpMyAdmin 安装教程全攻略

    管理MYSQL数据库的最好工具是PHPmyAdmin,现在最新版本是phpMyAdmin 2.9.0.2,这是一个国际上开源的软件,一直在更新版本,你可以从 http://www.phpmyadmin ...

  6. ARM7开发板模拟器Skyeye安装设置全攻略

    本文目的:在linux里装Skyeye,用Skyeye模拟ARM7DTMI,运行uClinnux-2.4.x SkyEye可以做什么事情? 1. 通过SkyEye可以帮助促进嵌入式系统的学习,在不需要 ...

  7. EndeavourOS安装配置全攻略!

    安装 添加Archlinuxcn软件源 编辑配置 执行下面命令编辑文件: vi /etc/pacman.conf 在文件的末尾添加2行内容: [archlinuxcn] Server = https: ...

  8. Chrome OS安装配置全攻略

    对于Chrome大家应该都不陌生吧,非常好用的一款浏览器,尤其是强大的同步功能,对于我这种经常游离于各种电脑之间的人来说特别方便.而Chrome OS则是把Chrome做到了极致:Google觉得wi ...

  9. Jenkins 插件安装方式全攻略

    在Jenkins 的安装向导页面中, 会有一步是否安装推荐的插件, 可以直接进行安装, 也可以跳过. 对于安装机器联网的状况, 安装插件相对方便,直接搜索插件安装, 但是也可能会出现无法在线安装的状况 ...

最新文章

  1. extjs4.0视频教程下载
  2. 管理者的智慧:靠制度管人,不靠人管人
  3. 三点顺序(计算几何)
  4. 第二十五天 how can I 坚持
  5. 【C++ STL学习之一】容器的共通能力和共通操作总结
  6. 深度学习工作笔记003---数据预处理:独热编码(One-Hot Encoding)
  7. proxmoxve打造云桌面_最大亮点!山东众志电子为山东财经大学东方学院打造首个200点位云桌面考场...
  8. Python进阶(五)模块、包详解
  9. 多目标跟踪-Multi-Object Tracking
  10. 关于计算机组件游戏,电脑游戏运行库组件补全的方法
  11. 上传iOS应用时 ERROR ITMS-90096: Your binary is not optimized for iPhone 5。。。
  12. 深度剖析Pyechars Graph关系图谱
  13. 陈彤一个网络编辑的11年
  14. python 指定值的位置_python数组查找某个值的位置
  15. python 流水作业调度_动态规划——流水作业调度问题
  16. 给所有大龄测试员写的一份信
  17. VUE 中 keep-alive 的 --是什么-- 使用场景-- 作用-- 新增属性--动态组件--理解
  18. Daily Growing 的歌词
  19. php ffmpeg 转码mp4,PHP+FFMPEG实现将视频自动转码成H264标准Mp4文件
  20. protocol method: #method<connection.close>(reply-code=530, reply-text=NOTALLOWED - vhost / not found

热门文章

  1. 2021年河南高考成绩查询 囗,2021年高考人数出炉了,河南和山东总人口相当,考生却多45万,有蹊跷...
  2. python数字转成字符串
  3. win10 字体修改美化
  4. CSP-J/S 自闭加憨憨记
  5. 图像特征描述子(一)——HOG
  6. 游戏行业的“游戏盾”有什么作用?
  7. 学习java前的屁话
  8. vue服务端渲染 MySQL_vue服务端渲染
  9. 我也上去了!GodGuide!
  10. 【JavaScript】面向对象、原型和原型链、继承