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. CDH版本大数据集群下搭建的Hue详细启动步骤(图文详解)

    关于安装请见 CDH版本大数据集群下搭建Hue(hadoop-2.6.0-cdh5.5.4.gz + hue-3.9.0-cdh5.5.4.tar.gz)(博主推荐) Hue的启动 也就是说,你Hue ...

  2. Educational Codeforces Round 18 D

    Description T is a complete binary tree consisting of n vertices. It means that exactly one vertex i ...

  3. 线段树(成段更新) POJ 3468 A Simple Problem with Integers

    题目传送门 /* 线段树-成段更新:裸题,成段增减,区间求和 注意:开long long:) */ #include <cstdio> #include <iostream> ...

  4. Reduce实现

    Reduce实现 参考 第一版 Array.prototype.fakeReduce = function (fn, base) { // this 指向原数组 // 拷贝数据, 更改指针方向 var ...

  5. 18.5.1使用Proxy和InvocationHandler创建动态代理

    package d18_5_1; public interface Person { void walk(); void sayHello(String name); } package d18_5_ ...

  6. RAID 0、1、5、1+0总结

    RAID(Redundant Array Of Independent Disk,独立磁盘冗余阵列),可以提供比普通磁盘更快的速度.更高的安全性,生产环境中服务器在安装时一般都会做RAID,RAID的 ...

  7. PHP 讓 json_encode() 指定回傳格式

    PHP 回傳 JSON 很方便, 只要將資料經過 json_encode() 就解決了. 不過因為 PHP 自動轉換型別, 造成很多資料都習慣存成字串, 希望在輸出 JSON 的時候, 數字部份可以輸 ...

  8. 2019/05/11 Java内存结构

    1.  类加载子系统:负责从文件系统或者网络加载Class信息,加载的信息存放在一块称之方法区的内存空间. 2.  方法区:就是存放类的信息.常量信息.常量池信息.包括字符串字面量和数字常量等. 3. ...

  9. HTML的历史与历史遗留问题

    1. <style type="text/css"> 从前,HTML的设计者认为以后应该还会有其他样式,不过如今我们已经醒悟,事实表明,完全可以只使用<style ...

  10. prevent to do sth 与 prevent sb (from) doing 用法

    prevent to do sth 如: Do not water in before making a turn every time 9 days, make wilting of its bra ...