Python Tensorflow:Cuda 计算能力 3.0。最低要求的 Cuda 能力是 3.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39023581/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 21:46:53  来源:igfitidea点击:

Tensorflow: Cuda compute capability 3.0. The minimum required Cuda capability is 3.5

pythontensorflowgpubazel

提问by Abhijay Ghildyal

I am installing tensorflow from source (documentation).

我正在从源(文档)安装 tensorflow 。

Cuda driver version:

Cuda驱动版本:

nvcc: NVIDIA (R) Cuda compiler driver
Cuda compilation tools, release 7.5, V7.5.17

When I ran the following command :

当我运行以下命令时:

bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu

it gave me the following error :

它给了我以下错误:

I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_init.cc:118] Found device 0 with properties: 
name: GeForce GT 640
major: 3 minor: 0 memoryClockRate (GHz) 0.9015
pciBusID 0000:05:00.0
Total memory: 2.00GiB
Free memory: 1.98GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:138] DMA: 0 
I tensorflow/core/common_runtime/gpu/gpu_init.cc:148] 0:   Y 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:843] Ignoring gpu device (device: 0, name: GeForce GT 640, pci bus id: 0000:05:00.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
F tensorflow/cc/tutorials/example_trainer.cc:128] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Cast': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
     [[Node: Cast = Cast[DstT=DT_FLOAT, SrcT=DT_INT32, _device="/gpu:0"](Const)]])
F tensorflow/cc/tutorials/example_trainer.cc:128] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Cast': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
     [[Node: Cast = Cast[DstT=DT_FLOAT, SrcT=DT_INT32, _device="/gpu:0"](Const)]])
F tensorflow/cc/tutorials/example_trainer.cc:128] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Cast': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
     [[Node: Cast = Cast[DstT=DT_FLOAT, SrcT=DT_INT32, _device="/gpu:0"](Const)]])
F tensorflow/cc/tutorials/example_trainer.cc:128] Check failed: ::tensorflow::Status::OK() == (session->Run({{"x", x}}, {"y:0", "y_normalized:0"}, {}, &outputs)) (OK vs. Invalid argument: Cannot assign a device to node 'Cast': Could not satisfy explicit device specification '/gpu:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
     [[Node: Cast = Cast[DstT=DT_FLOAT, SrcT=DT_INT32, _device="/gpu:0"](Const)]])
Aborted (core dumped)

Will I need a different gpu to run this?

我需要一个不同的 GPU 来运行它吗?

回答by Manoj Kumar Das

I have installed Tensorflow revision 1.8. It recommends CUDA 9.0. I am using a GTX 650M card which has CUDA compute capability 3.0 and now works like a charm. OS is ubuntu 18.04. Below are detailed steps:

我已经安装了 Tensorflow 1.8 版。它推荐 CUDA 9.0。我正在使用具有 CUDA 计算能力 3.0 的 GTX 650M 卡,现在它的工作原理非常棒。操作系统是 ubuntu 18.04。下面是详细步骤:

Installing dependencies

安装依赖

I have included ffmpeg and some related packages for my opencv 3.4 compilation, if not required do not install Run the below commands:

我已经为我的 opencv 3.4 编译包含了 ffmpeg 和一些相关包,如果不需要,请不要安装运行以下命令:

sudo apt-get update 
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get upgrade
sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install ffmpeg -y
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install python-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install unzip qtbase5-dev python-dev python3-dev python-numpy python3-numpy -y
sudo apt-get install libopencv-dev libgtk-3-dev libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev >libjasper-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev -y
sudo apt-get install libv4l-dev libtbb-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev -y
sudo apt-get install libvorbis-dev libxvidcore-dev v4l-utils vtk6 -y
sudo apt-get install liblapacke-dev libopenblas-dev libgdal-dev checkinstall -y
sudo apt-get install libgtk-3-dev -y
sudo apt-get install libatlas-base-dev gfortran -y
sudo apt-get install qt-sdk -y
sudo apt-get install python2.7-dev python3.5-dev python-tk -y
sudo apt-get install cython libgflags-dev -y
sudo apt-get install tesseract-ocr -y
sudo apt-get install tesseract-ocr-eng -y 
sudo apt-get install tesseract-ocr-ell -y
sudo apt-get install gstreamer1.0-python3-plugin-loader -y
sudo apt-get install libdc1394-22-dev -y
sudo apt-get install openjdk-8-jdk
sudo apt-get install pkg-config zip g++-6 gcc-6 zlib1g-dev unzip  git
sudo wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install -U pip
sudo pip install -U numpy
sudo pip install -U pandas
sudo pip install -U wheel
sudo pip install -U six

Installing the nvidia driver

安装 nvidia 驱动程序

Run the below commands:

运行以下命令:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-390 -y

Reboot and run the below command and it should give you details as described in the image below: enter image description here

重新启动并运行以下命令,它应该为您提供如下图所述的详细信息: 在此处输入图片说明

gcc-6 and g++-6 checks.

gcc-6 和 g++-6 检查。

gcc-6 and g++-6 is required for CUDA 9.0, run the below commands:

CUDA 9.0 需要 gcc-6 和 g++-6,运行以下命令:

cd /usr/bin 
sudo rm -rf gcc gcc-ar gcc-nm gcc-ranlib g++
sudo ln -s gcc-6 gcc
sudo ln -s gcc-ar-6 gcc-ar
sudo ln -s gcc-nm-6 gcc-nm
sudo ln -s gcc-ranlib-6 gcc-ranlib
sudo ln -s g++-6 g++

Installing CUDA 9.0

安装 CUDA 9.0

Go to https://developer.nvidia.com/cuda-90-download-archive. Select options: Linux->x86_64->Ubuntu->17.04->deb(local). Download the main file and the two patches. Run below commands:

转到https://developer.nvidia.com/cuda-90-download-archive。选择选项:Linux->x86_64->Ubuntu->17.04->deb(local)。下载主文件和两个补丁。运行以下命令:

sudo dpkg -i cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

Navigate to the first patch on your PC and double click it, it will automatically execute, follow same for second patch.

导航到 PC 上的第一个补丁并双击它,它会自动执行,第二个补丁也是如此。

Add below to lines to your ~/.bashrc file and give it a reboot:

将以下行添加到您的 ~/.bashrc 文件并重新启动:

export PATH=/usr/local/cuda-9.0/bin${PATH:+:$PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Installing cudnn 7.1.4 for CUDA 9.0

为 CUDA 9.0 安装 cudnn 7.1.4

Download the tar file from https://developer.nvidia.com/cudnnand extract it to your Downloads folder Download requires a nvidia developed login, free sign-up Run the below commands:

https://developer.nvidia.com/cudnn下载 tar 文件并将其解压缩到您的 Downloads 文件夹下载需要 nvidia 开发的登录名,免费注册运行以下命令:

cd ~/Downloads/cudnn-9.0-linux-x64-v7.1/cuda
sudo cp include/* /usr/local/cuda/include/
sudo cp lib64/libcudnn.so.7.1.4 lib64/libcudnn_static.a /usr/local/cuda/lib64/
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libcudnn.so.7.1.4 libcudnn.so.7
sudo ln -s libcudnn.so.7 libcudnn.so

Installing NCCL 2.2.12 for CUDA 9.0

为 CUDA 9.0 安装 NCCL 2.2.12

Download the tar file from https://developer.nvidia.com/nccland extract it to your Downloads folder Download requires a nvidia developed login, free sign-up Run the below commands:

https://developer.nvidia.com/nccl下载 tar 文件并将其解压缩到您的 Downloads 文件夹下载需要 nvidia 开发的登录名,免费注册运行以下命令:

sudo mkdir -p /usr/local/cuda/nccl/lib /usr/local/cuda/nccl/include
cd ~/Downloads/nccl-repo-ubuntu1604-2.2.12-ga-cuda9.0_1-1_amd64/
sudo cp *.txt /usr/local/cuda/nccl
sudo cp include/*.h /usr/include/
sudo cp lib/libnccl.so.2.1.15 lib/libnccl_static.a /usr/lib/x86_64-linux-gnu/
sudo ln -s /usr/include/nccl.h /usr/local/cuda/nccl/include/nccl.h
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libnccl.so.2.1.15 libnccl.so.2
sudo ln -s libnccl.so.2 libnccl.so
for i in libnccl*; do sudo ln -s /usr/lib/x86_64-linux-gnu/$i /usr/local/cuda/nccl/lib/$i; done

Install Bazel (the recomended manual installation of bazel worked, for reference: https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu)

安装 Bazel(推荐手动安装 bazel 工作,参考:https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu )

Download "bazel-0.13.1-installer-darwin-x86_64.sh" from https://github.com/bazelbuild/bazel/releasesRun the below commands:

https://github.com/bazelbuild/bazel/releases下载“bazel-0.13.1-installer-darwin-x86_64.sh” 运行以下命令:

chmod +x bazel-0.13.1-installer-darwin-x86_64.sh
./bazel-0.13.1-installer-darwin-x86_64.sh --user
export PATH="$PATH:$HOME/bin"

Compiling Tensorflow

编译 Tensorflow

We will compile with CUDA, with XLA JIT (oh yeah) and jemalloc as malloc support. So we enter yes for these things. Run the below command and answer to the queries as described for running configuration

我们将使用 CUDA、XLA JIT(哦是的)和 jemalloc 作为 malloc 支持进行编译。所以我们为这些事情输入 yes。运行以下命令并按照运行配置的描述回答查询

git clone https://github.com/tensorflow/tensorflow 
git checkout r1.8
./configure
You have bazel 0.13.0 installed.
Please specify the location of python. [Default is /usr/bin/python]:
Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: y
jemalloc as malloc support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
No Google Cloud Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n
No Hadoop File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
No Amazon S3 File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Apache Kafka Platform support? [Y/n]: n
No Apache Kafka Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with XLA JIT support? [y/N]: y
XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with GDR support? [y/N]: n
No GDR support will be enabled for TensorFlow.
Do you wish to build TensorFlow with VERBS support? [y/N]: n
No VERBS support will be enabled for TensorFlow.
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: y
CUDA support will be enabled for TensorFlow.
Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 9.0]:
Please specify the location where CUDA 9.1 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.1.4
Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Do you wish to build TensorFlow with TensorRT support? [y/N]: n
No TensorRT support will be enabled for TensorFlow.
Please specify the NCCL version you want to use. [Leave empty to default to NCCL 1.3]: 2.2.12
Please specify the location where NCCL 2 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:/usr/local/cuda/nccl
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 3.0]
Do you want to use clang as CUDA compiler? [y/N]: n
nvcc will be used as CUDA compiler.
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/x86_64-linux-gnu-gcc-7]: /usr/bin/gcc-6
Do you wish to build TensorFlow with MPI support? [y/N]: n
No MPI support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
 --config=mkl          # Build with MKL support.

 --config=monolithic   # Config for mostly static monolithic build.

Configuration finished

Now to compile tensorflow, run below command, this is super RAM consuming and will take time. You can remove "--local_resources 2048,.5,1.0" from below line if you have a lot of RAM or this will work on 2 GB of RAM

现在要编译 tensorflow,运行下面的命令,这会消耗大量 RAM 并且需要时间。如果您有很多 RAM,您可以从下面的行中删除“--local_resources 2048,.5,1.0”,否则这将适用于 2 GB 的 RAM

bazel build --config=opt --config=cuda --local_resources 2048,.5,1.0 //tensorflow/tools/pip_package:build_pip_package

Once the compilation is completed you will have thing appear as per the image below confirming it was a success enter image description here

编译完成后,您将看到如下图所示的内容,确认成功 在此处输入图片说明

Build the wheel file, run below:

构建wheel文件,在下面运行:

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

Install the generated wheel file using pip

使用pip安装生成的wheel文件

sudo pip install /tmp/tensorflow_pkg/tensorflow*.whl

To explore on the devices now you can run tensorflow, below image is the showcase on ipython terminal

现在要在设备上进行探索,您可以运行 tensorflow,下图是 ipython 终端上的展示

enter image description here

在此处输入图片说明

回答by M. Balcilar

In anaconda, tensorflow-gpu=1.12 with cudatoolkit=9.0 is compatible with gpu which has 3.0 compute capability. Here is the ccommand for creating new environment, and installation of necessary libraries for 3.0 gpus.

在 anaconda 中,tensorflow-gpu=1.12 和 cudatoolkit=9.0 与具有 3.0 计算能力的 gpu 兼容。这是用于创建新环境和为 3.0 gpus 安装必要库的 ccommand。

conda create -n tf-gpu
conda activate tf-gpu
conda install tensorflow-gpu=1.12
conda install cudatoolkit=9.0

then you can try it by followings.

那么您可以通过以下方式尝试。

>python
import tensorflow as tf
tf.Session()

Here is my output

这是我的输出

name: GeForce GT 650M major: 3 minor: 0 memoryClockRate(GHz): 0.95 pciBusID: 0000:01:00.0 totalMemory: 3.94GiB freeMemory: 3.26GiB 2019-12-09 13:26:11.753591: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0 2019-12-09 13:26:12.050152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-12-09 13:26:12.050199: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 2019-12-09 13:26:12.050222: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N 2019-12-09 13:26:12.050481: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2989 MB memory) -> physical GPU (device: 0, name: GeForce GT 650M, pci bus id: 0000:01:00.0, compute capability: 3.0)

名称:GeForce GT 650M 主要:3 次要:0 memoryClockRate(GHz):0.95 pciBusID:0000:01:00.0 totalMemory:3.94GiB freeMemory:3.26GiB 2019-12-09 13:2535913:25359 13:25359 13:7535911000000000000000000000000000000000M gpu/gpu_device.cc:1511] 添加可见 gpu 设备:0 2019-12-09 13:26:12.050152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 设备互连 StreamExecutor,强度为 19 边矩阵:201 -12-09 13:26:12.050199: 我 tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 2019-12-09 13:26:12.050222: 我 tensorflow/core/common_runtime/gpu.pu 1001] 0: N 2019-12-09 13:26:12.050481: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 创建 TensorFlow 设备 (/job:localhost/replica:0/task:0/device: GPU:0 2989 MB 内存)-> 物理 GPU(设备:0,名称:GeForce GT 650M,pci 总线 ID:0000:01:00.0,计算能力:3.0)

Enjoy !

享受 !

回答by Manoj Kumar Das

@Taako, so sorry for this late response. I did not save the wheel file of the compilation displayed above. However, here is a new one for tensorflow 1.9. Hope this helps you enough. Kindly ensure of the below details used for the build.

@Taako,很抱歉这么晚回复。我没有保存上面显示的编译的轮文件。但是,这是 tensorflow 1.9 的新内容。希望这对你有足够的帮助。请确保以下用于构建的详细信息。

Tensorflow: 1.9 CUDA Toolkit: 9.2 CUDNN: 7.1.4 NCCL: 2.2.13

Tensorflow:1.9 CUDA 工具包:9.2 CUDNN:7.1.4 NCCL:2.2.13

Below is the link to the wheel file: wheel file

以下是轮文件的链接: 轮文件

回答by Bill M

Thank you for making your WHL available! I am now finally able to work with TF when I was fighting for days just to compile it (without success), as my laptop only supports Compute 3.0. I was not able to compile with your instructions on a fresh install of Ubuntu 18.04, and wanted to point out a couple of things:

感谢您提供 WHL!我现在终于可以使用 TF 了,因为我的笔记本电脑只支持 Compute 3.0,所以我为了编译它而奋斗了好几天(没有成功)。我无法按照您关于全新安装 Ubuntu 18.04 的说明进行编译,并想指出以下几点:

  • In your 'Dependencies' section, libjasper is no longer available independently, ffmpeg is no longer available from the repository you have listed, and libtiff5-dev is no longer available (I think there is a new version of this). I know this is mostly for the OpenCV stuff, which I use too. You also have a couple of packages repeated, like git and unzip.
  • In your 'Nvidia Driver' section, I don't think that driver is available from the repository. At least I couldn't pull it. With your built WHL file I am using the 418 driver from the Nvidia website, and that seems to be working well.
  • In your 'Installing cudnn 7.1.4 for CUDA 9.0' section, you 'cd /usr/lib/x86_64-linux-gnu', but the files are in /usr/local/cuda. Is this correct? I'm guessing the links would at least have to be told to point back to the cuda folder.
  • In section 'Installing NCCL 2.2.12 for CUDA 9.0' you are using 2.2.12, but your command lines all reference 2.1.15
  • In your Bazel install section, you say to use the Bazel Darwin installer, but I think this is for Mac. I think you need the Bazel Linux installer.
  • 在您的“依赖项”部分,libjasper 不再独立可用,ffmpeg 不再从您列出的存储库中可用,并且 libtiff5-dev 不再可用(我认为有一个新版本)。我知道这主要用于 OpenCV 的东西,我也使用它。您还重复了几个包,例如 git 和 unzip。
  • 在您的“Nvidia 驱动程序”部分,我认为存储库中没有该驱动程序。至少我拉不动。使用您构建的 WHL 文件,我使用 Nvidia 网站上的 418 驱动程序,这似乎运行良好。
  • 在您的“为 CUDA 9.0 安装 cudnn 7.1.4”部分中,您“cd /usr/lib/x86_64-linux-gnu”,但文件在 /usr/local/cuda 中。这样对吗?我猜这些链接至少必须被告知指向 cuda 文件夹。
  • 在“为 CUDA 9.0 安装 NCCL 2.2.12”一节中,您使用的是 2.2.12,但您的命令行都参考 2.1.15
  • 在您的 Bazel 安装部分,您说要使用 Bazel Darwin 安装程序,但我认为这是适用于 Mac 的。我认为您需要 Bazel Linux 安装程序。

Thanks again for all of your work on this!

再次感谢您为此所做的所有工作!

P.S. I was able to get this to build by doing a git checkout of Tensorflow 1.12 following these instructions and by pip installing keras_applications and keras_preprocessing, using CUDA 9.2, CUDNN 7.1.4, and NCCL 2,2,13, using Bazel 0.15.0. Some have pointed out that CUDA 9.0 can't be compiled against with gcc6/g++6. Apparently 9.2 can.

PS我能够通过按照这些说明执行Tensorflow 1.12的git checkout并通过pip安装keras_applications和keras_preprocessing,使用CUDA 9.2,CUDNN 7.1.4和NCCL 2,2,13,使用Bazel 0.15.0来构建它. 有人指出 CUDA 9.0 不能用 gcc6/g++6 编译。显然9.2可以。