我正在尝试使用Tensorflow运行seq2seq示例,但它不会使用GPU。以下是我在安装Tensorflow到搭载Tesla K20x的Linux系统上所采取的步骤:
git clone --recurse-submodules https://github.com/tensorflow/tensorflow
./configure # Yes GPU
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu # The GPU is being used)
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
在完成所有步骤后,我已经成功安装了TensorFlow。接下来,我尝试运行seq2seq示例,方法如下:
bazel run -c opt //tutorials/models/rnn/translate:translate
但它不会使用GPU。然后我尝试了这个例子。
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
并且它会报错。
bazel-bin/tensorflow/cc/tutorials_example_trainer: error while loading shared libraries: /path/to/home/.cache/bazel/_bazel_hduong/9e8a6e75473e7bf5c9d1c8a084e2a0e9/tensorflow/bazel-out/local_linux-opt/bin/tensorflow/cc/../../_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64/libcudart.so.7.0: file too short
请问有人知道为什么程序不使用GPU吗?谢谢。