python - Tensorflow 不显示 "Successfully opened so & so CUDA libraries locally"

标签 python tensorflow bazel

我将 tensorflow 配置为在我的 GPU (GeForce 840M) 上使用 CUDA 支持,但与我之前使用的 CPU 相比,这些程序运行起来相当。此外,当我运行该程序时,我没有收到任何类型的消息,表明某某 CUDA 库已成功打开。相反,这是我在运行任何 tensorflow 程序时在日志中得到的:

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 head,因为它产生了问题,我使用了提供的相同优化标志 bazel build -c opt --config=cuda//tensorflow/tools/pip_package :build_pip_package 当通过 bazel 构建时。

最佳答案

您是否使用 nvidia-smi 来判断您是否安装了正确的 cuda 驱动程序以及您的 gpu 是否对系统可见?

在 TF 中你可以设置 log_device_placement了解是否有任何操作被分配给 GPU 的选项。

关于python - Tensorflow 不显示 "Successfully opened so & so CUDA libraries locally",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43059726/

相关文章:

python - 替换 Python 多处理库中的 pickle

python - 在 Python 中对关联数组进行排序

tensorflow - ValueError : Error when checking input: expected conv2d_1_input to have shape (28, 28, 1) 但得到形状为 (28, 28, 3) 的数组

tensorflow - 为什么tensorflow的AdamOptimizer的实现不支持L2归一化

python - 使用protobuf编译时是否可以循环,将.proto文件转换为.py文件?

python - Bazel:从 py_library 中的 python 文件创建 py_binary

python - 在 __init__.py 中递归填充 __all__

python - ${python3 :Depends} mean in a debian source-package control file? 是什么

compiler-errors - Mac OS Lion的Bazel

bazel - 使用 Bazel 运行 Checker 框架