【发布时间】:2018-08-10 11:30:31
【问题描述】:
我有一个来自 Amazon EC2 和 Ubuntu Bionics 的 p3.2xlarge 模板。它应该安装了 GPU 设备。但是当我运行这段代码时,它说没有 GPU。现在,这是一台虚拟机而不是物理机,但仍然应该有 GPU。请注意,我使用 Docket 启动了 TensorFlow,如果缺少 GPU,它不应该工作:
sudo docker run -it -p 8888:8888 tensorflow/tensorflow
sess.close()
with tf.device('/device:CPU: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)
with tf.Session() as sess:
print (sess.run(c))
我收到此错误:
InvalidArgumentError: Cannot assign a device for operation 'MatMul': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]
但是已经加载了 NVIDIA 驱动,没有设备就无法加载:
lspci -nn | grep '\[03'
00:02.0 VGA compatible controller [0300]: Cirrus Logic GD 5446 [1013:00b8]
00:1e.0 3D controller [0302]: NVIDIA Corporation GV100GL [Tesla V100 SXM2 16GB] [10de:1db1] (rev a1)
还有
dpkg -l "*cuda*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii cuda-command-l 9.0.176-1 amd64 CUDA command-line tools
ii cuda-core-9-0 9.0.176.3-1 amd64 CUDA core tools
ii cuda-cublas-9- 9.0.176.4-1 amd64 CUBLAS native runtime libraries
ii cuda-cudart-9- 9.0.176-1 amd64 CUDA Runtime native Libraries
ii cuda-cudart-de 9.0.176-1 amd64 CUDA Runtime native dev links, he
ii cuda-cufft-9-0 9.0.176-1 amd64 CUFFT native runtime libraries
ii cuda-curand-9- 9.0.176-1 amd64 CURAND native runtime libraries
ii cuda-cusolver- 9.0.176-1 amd64 CUDA solver native runtime librar
ii cuda-cusparse- 9.0.176-1 amd64 CUSPARSE native runtime libraries
ii cuda-driver-de 9.0.176-1 amd64 CUDA Driver native dev stub libra
ii cuda-license-9 9.0.176-1 amd64 CUDA licenses
ii cuda-misc-head 9.0.176-1 amd64 CUDA miscellaneous headers
ii cuda-repo-ubun 9.1.85-1 amd64 cuda repository configuration fil
un libcuda1-340 <none> <none> (no description available)
ii nvinfer-runtim 1.0-1 amd64 nvinfer-runtime-trt repository co
ii nvinfer-runtim 1-1 amd64 nvinfer-runtime-trt repository co
【问题讨论】:
-
“但是加载了 NVIDIA 驱动程序,没有设备就无法加载这些驱动程序:” - 您在问题中显示的任何内容都无法证实这一点。我真的很难在这里看到 programming 问题.....
-
另请注意,CUDA 9.0 不支持 Ubuntu 18
-
好的,我会尝试 9.2,它似乎是最新的。
-
不要。除非最近发生了变化,否则没有支持 CUDA 9.2 的 Tensorflow 二进制版本。
-
我将暂时搁置它。 CUDA 还不支持 Ubuntu Bionics。
标签: tensorflow nvidia