Tensorflow没有显示“已成功打开,因此&因此CUDA本地库" [英] Tensorflow not showing "Successfully opened so & so CUDA libraries locally"

查看:207
本文介绍了Tensorflow没有显示“已成功打开,因此&因此CUDA本地库"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux(GeForce 840M)上配置了tensorflow以支持CUDA,但与我以前的CPU相比,这些程序的运行.另外,我没有没有收到任何消息,提示我在运行程序时某某CUDA库已成功打开.相反,这是我运行任何tensorflow程序时在日志中得到的内容:

I configured tensorflow to work with CUDA support on my GPU (GeForce 840M) but the programs are running quite slow in compare to what my CPU used to earlier. Also, I do not get any kind of message that the so and so CUDA library was successfully opened when I run the program. Instead, this is what I get in logs when I run any tensorflow program:

python Neuralnet.py 
Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Extracting /tmp/data/train-images-idx3-ubyte.gz
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Extracting /tmp/data/train-labels-idx1-ubyte.gz
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Extracting /tmp/data/t10k-images-idx3-ubyte.gz
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting /tmp/data/t10k-labels-idx1-ubyte.gz
2017-03-28 07:53:57.979382: W tensorflow/core/platform/cpu_feature_guard.cc:45]
    The TensorFlow library wasn't compiled to use SSE4.1 instructions, 
    but these are available on your machine and could speed up CPU computations.
2017-03-28 07:53:57.979413: W tensorflow/core/platform/cpu_feature_guard.cc:45]
    The TensorFlow library wasn't compiled to use SSE4.2 instructions, 
    but these are available on your machine and could speed up CPU computations.
2017-03-28 07:53:57.979431: W tensorflow/core/platform/cpu_feature_guard.cc:45] 
    The TensorFlow library wasn't compiled to use AVX instructions, 
    but these are available on your machine and could speed up CPU computations.
2017-03-28 07:53:57.979438: W tensorflow/core/platform/cpu_feature_guard.cc:45] 
    The TensorFlow library wasn't compiled to use AVX2 instructions, 
    but these are available on your machine and could speed up CPU computations.
2017-03-28 07:53:57.979447: W tensorflow/core/platform/cpu_feature_guard.cc:45] 
    The TensorFlow library wasn't compiled to use FMA instructions, 
    but these are available on your machine and could speed up CPU computations.
2017-03-28 07:53:58.233876: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] 
    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-03-28 07:53:58.234333: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] 
Found device 0 with properties: 
name: GeForce 840M
major: 5 minor: 0 memoryClockRate (GHz) 1.124
pciBusID 0000:08:00.0
Total memory: 1.96GiB
Free memory: 1.75GiB
2017-03-28 07:53:58.234362: I tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0 
2017-03-28 07:53:58.234372: I tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0:   Y 
2017-03-28 07:53:58.234388: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 
Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce 840M, pci bus id: 0000:08:00.0)
('Epoch', 0, 'completed out of', 15, 'loss:', 115374329.04653475)

依此类推,程序开始运行,但是并没有按照我的期望运行.我从官方文档中安装了CUDA,但是我没有重置git master头,因为它正在创建问题,并且在通过bazel构建时使用了与bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package相同的优化标志.

And so on the program started runnning but it didn't ran any faster according to my expectations. I installed CUDA from the official documentation, but I did not reset the git master head since it was creating issues and I used the same optimization flags provided bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package when building through bazel.

推荐答案

您是否使用nvidia-smi来告知您是否安装了正确的cuda驱动程序,以及系统是否可以看到您的gpu?

Did you use nvidia-smi to tell whether you have the right cuda drivers installed and that your gpu is visible to the system?

在TF中,您可以设置 log_device_placement 选项以了解是否有任何操作分配给GPU.

In TF you can set the log_device_placement option to understand if any ops are being assigned to the GPU.

这篇关于Tensorflow没有显示“已成功打开,因此&因此CUDA本地库"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆