1、准备工作

1.1 确保GPU驱动已经安装

lspci | grep -i nvidia 通过此命令可以查看GPU信息,测试机已经安装GPU驱动
nvidia-smi 可以查看英伟达显卡信息

1.2 确保gcc安装

可以通过gcc -v 查看,如果没有安装需要安装

1.3 确保安装open-ssh

如果没有安装可以通过 yum install openssh-server 安装
1.4 确保安装kernel
 sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

2、安装CUDA工具包

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit.
备注:测试机选用的是CUDA 8.0,不要使用9.x 有坑

3、安装GPU加速器cuDNN

安装完CUDA就可以安装 cuDNN .
备注:这个地方要选用与CUDA版本匹配的加速器;测试机选用的是:Download cuDNN v6.0 (April 27, 2017), for CUDA 8.0,安装步骤如下图所示:

4、安装或更新pip(如果有需要的话,如果已经有了,可以选择性跳过)

TensorFlow itself can be installed using the pip package manager. First, make sure that your system has pip installed and updated:
$ sudo apt-get install python-pip python-dev
$ pip install --upgrade pip

5、安装TensorFlow

Run the following command to install the TensorFlow Python package using pip:
$ pip install --upgrade tensorflow-gpu

6、测试安装是否成功

To test the installation, open an interactive Python shell and import the TensorFlow module:
 
Python 3.5.3 (default, Jun 23 2017, 16:12:41)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> sess = tf.Session()
2017-07-12 19:24:14.030098: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-07-12 19:24:14.030833: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: Tesla M40 24GB
major: 5 minor: 2 memoryClockRate (GHz) 1.112
pciBusID 0000:00:06.0
Total memory: 22.40GiB
Free memory: 22.29GiB
2017-07-12 19:24:14.030855: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-07-12 19:24:14.030867: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y
2017-07-12 19:24:14.030882: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla M40 24GB, pci bus id: 0000:00:06.0)
>>> hello_world = tf.constant("Hello, TensorFlow!")
>>> print (sess.run(hello_world))
b'Hello, TensorFlow!'
>>> print (sess.run(tf.constant(123)*tf.constant(456)))
56088
>>>
参考链接

tensorflow with gpu 环境配置的更多相关文章

  1. 深度学习 GPU环境 Ubuntu 16.04 + Nvidia GTX 1080 + Python 3.6 + CUDA 9.0 + cuDNN 7.1 + TensorFlow 1.6 环境配置

    本节详细说明一下深度学习环境配置,Ubuntu 16.04 + Nvidia GTX 1080 + Python 3.6 + CUDA 9.0 + cuDNN 7.1 + TensorFlow 1.6 ...

  2. NXP S32V eiq_auto tensorflow offline tool 环境配置

    NXP S32V eiq_auto tensorflow offline tool 环境配置 完成cnn模型eiq移植的第一步 1.安装conda 下载.sh bash Anaconda3-5.3.1 ...

  3. cuda cudnn anaconda gcc tensorflow 安装及环境配置

    1.首先,默认你已经装了适合你的显卡的nvidia驱动. 到  http://www.nvidia.com/Download/index.aspx 搜索你的显卡需要的驱动型号 那么接下来就是cuda的 ...

  4. lightGBM gpu环境配置

    推荐先看一手官方的Installation Guide.我用的是ubuntu 16.04,一些要求如下图: 主要是OpenCL以及libboost两个环境的要求. (1) OpenCL的安装.我这里之 ...

  5. 【适合N卡独显电脑的环境配置】Tensorflow教程-Windows 10下安装tensorflow 1.5.0 GPU with Anaconda

    注意: 1.目前Anaconda 更新原命令activate tensorflow 改为 conda activate tensorflow 2. 目前windows with anaconda 可以 ...

  6. 深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow

    深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow 最近在公司做深度学习相关的学习和实验,原来一直 ...

  7. 深度学习主机环境配置: Ubuntu16.04+GeForce GTX 1080+TensorFlow

    接上文<深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0>,我们继续来安装 TensorFlow,使其支持GeForce GTX 1080显卡 ...

  8. 转:ubuntu 下GPU版的 tensorflow / keras的环境搭建

    http://blog.csdn.net/jerr__y/article/details/53695567 前言:本文主要介绍如何在 ubuntu 系统中配置 GPU 版本的 tensorflow 环 ...

  9. Google TensorFlow for GPU安装、配置大坑

    Google TensorFlow for GPU安装.配置大坑 从本周一开始(12.05),共4天半的时间,终于折腾好Google TensorFlow for GPU版本,其间跳坑无数,摔得遍体鳞 ...

随机推荐

  1. 2018 年度码云热门项目排行榜 TOP 10

    2016 年度码云热门项目排行榜 TOP 10 是通过开源项目2016年在码云上的 Watch.Star.Fork 数量来评定的榜单.码云平台发展至今,涌现了越来越多优秀的开源项目,越来越多的开源作者 ...

  2. git简单使用方法

    跟远程库关联起来: http://www.cnblogs.com/Gabriel-Wei/p/6564102.html http://www.liaoxuefeng.com/wiki/00137395 ...

  3. iOS UILabel UITextView自适应文本,或文本大小自适应

    //UILabel自适应文本的高度 UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(, , , )]; label.numberOf ...

  4. 外文翻译 《How we decide》被情感愚弄 第一节

    本节为第三章的起始. 书的导言 本节阅读感言:情感系统脱离控制的后果是毁灭性的. Ann Klinestiver 在一所高中做英文老师,她被诊断为患帕金森综合症.在课堂上,当她正准备和学生们谈及一些莎 ...

  5. 关于ES6的Promise的使用深入理解

    ES6的promise对象研究 什么叫promise? Promise对象可以理解为一次执行的异步操作,使用promise对象之后可以使用一种链式调用的方式来组织代码:让代码更加的直观. 那我们为什么 ...

  6. html5表单新增的元素与属性

    1.表单内元素的form属性 在html4中,表单内的从属元素必须书写在表单内部, 而在html5中,可以把他们书写在页面上任何地方, 然后为该元素指定一个form属性,属性值为该表单的id,这样就可 ...

  7. os模块详解2

    1.os.getenv('HOME')  读取操作系统环境变量HOME的值. 2.os.environ 返回操作系统所有的环境变量. 3.os.environ.setdefault(‘a’,‘b’) ...

  8. configure: error: MySQL library not found

    在CentOS系统中,安装zabbix进行configure时会遇到以下问题 ./configure --enable-server --enable-agent --with-mysql --wit ...

  9. 两个已排序数组的合并-C语言

    最近在纸上写一个已排序数组的合并时,花了超过预期的时间.仔细想想,这种要放到毕业找工作那会两下就出来了,原因还在于工作后对基础没有重视,疏于练习. 说开一点,现在搜索引擎的发达确实给问题的解决带来了便 ...

  10. 洛谷 大牛分站 P1000 超级玛丽游戏

    题目背景 本题是洛谷的试机题目,可以帮助了解洛谷的使用. 建议完成本题目后继续尝试P1001.P1008. 题目描述 超级玛丽是一个非常经典的游戏.请你用字符画的形式输出超级玛丽中的一个场景. *** ...