简体   繁体   English

tensorFlow中的nvidia cuda 7.5驱动程序未正确处理(ubuntu 14.04)

[英]nvidia cuda 7.5 driver in tensorFlow are not properly handled (ubuntu 14.04)

After a an install without pb, I am trying the tutorial about GPUs : I type : 在没有pb的安装后,我正在尝试有关GPU的教程:我键入:

with tf.device('/gpu:0'):
  a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
  b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
  c = tf.matmul(a, b)
  print(c)
  sess.run(c)

I got : 我有 :

Tensor("MatMul_1:0", shape=TensorShape([Dimension(2), Dimension(2)]), dtype=float32, device=/gpu:0) Tensor(“ MatMul_1:0”,shape = TensorShape([Dimension(2),Dimension(2)]),dtype = float32,device = / gpu:0)

.

Traceback (most recent call last): File "", line 1, in File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 345, in run results = self._do_run(target_list, unique_fetch_targets, feed_dict_string) File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 419, in _do_run e.code) tensorflow.python.framework.errors.InvalidArgumentError: Cannot assign a device to node 'b_1': Could not satisfy explicit device specification '/gpu:0' [[Node: b_1 = Constdtype=DT_FLOAT, value=Tensor, _device="/gpu:0"]] Caused by op u'b_1', defined at: File "", line 3, in File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/ops/constant_op.py", line 147, in constant attrs={"value": tensor_value, "dtype": dtype_value}, name=name).outputs[0] File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1710, in create_op original_op=self._default_original_op, op_def=op_ 追溯(最近一次通话最近):文件“ /home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py”的第1行,第345行,运行结果= self._do_run(target_list,unique_fetch_targets,feed_dict_string)文件“ /home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py”,行_do_run e中的419行。代码)tensorflow.python.framework.errors.InvalidArgumentError:无法将设备分配给节点'b_1':无法满足显式设备规范'/ gpu:0'[[节点:b_1 = Constdtype = DT_FLOAT,value = Tensor,_device = “ / gpu:0”]]由操作u'b_1'引起,定义于:文件“ /home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/ ops / constant_op.py”,第147行,以常量attrs = {“ value”:张量值,“ dtype”:dtype_value},名称=名称)。outputs[0]文件“ / home / olivier / anaconda / lib / python2。 7 / site-packages / tensorflow / python / framework / ops.py“,行1710,位于create_op original_op = self._default_original_op,op_def = op_ def) File "/home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 988, in init self._traceback = _extract_stack() def)文件“ /home/olivier/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py”,第988行, init self._traceback = _extract_stack()

In Torch7, my GPU works normally 在Torch7中,我的GPU正常工作

The binaries published by google need to find libcudart.so.7.0 in the path library , you just need to add it to LD_LIBRARY_PATH by something like 谷歌发布的二进制文件需要在路径库中找到libcudart.so.7.0 ,您只需通过类似的方法将其添加到LD_LIBRARY_PATH

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/olivier/digits-2.0/lib/cuda"

that you put in your .bashrc 您放入您的.bashrc

On an optimus laptop (running Manjaro Linux) it's possible to run TensorFlow with cuda acceleration by starting a python console with optirun: 在optimus笔记本电脑(运行Manjaro Linux)上,可以通过使用optirun启动python控制台来以cuda加速运行TensorFlow:

$optirun python

I detailled the way to do it here . 我在这里详细介绍了这样做的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM