>>> print(tf.test.is_gpu_available())
2021-09-12 20:17:56.416492: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:17:56.417553: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:17:56.418404: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kobe/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 346, in new_func
return func(*args, **kwargs)
File "/home/kobe/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/framework/test_util.py", line 1665, in is_gpu_available
for local_device in device_lib.list_local_devices():
File "/home/kobe/miniconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/client/device_lib.py", line 45, in list_local_devices
_convert(s) for s in _pywrap_device_lib.list_devices(serialized_config)
RuntimeError: CUDA runtime implicit initialization on GPU:0 failed. Status: out of memory
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 错误内容 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> print(tf.test.is_gpu_available())
2021-09-12 20:21:40.055666: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.056565: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.057325: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.478674: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.479155: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.479567: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-09-12 20:21:40.479930: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /device:GPU:0 with 2816 MB memory: -> device: 0, name: NVIDIA GeForce GTX 960M, pci bus id: 0000:01:00.0, compute capability: 5.0
True
以上为展示成功
参考链接
https://blog.csdn.net/wc781708249/article/details/78029176
|