import tensorflow as tf tf.test.is_gpu_available() tf.config.list_physical_devices()
输出
1 2 3 4 5 6 7 8 9 10 11 12 13 14
2022-03-2223:53:58.209067: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:922] could not open file to read NUMA node: /sys/bus/pci/devices/0000:02:00.0/numa_node Your kernel may have been built without NUMA support. 2022-03-2223:53:58.210941: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:922] could not open file to read NUMA node: /sys/bus/pci/devices/0000:02:00.0/numa_node Your kernel may have been built without NUMA support. 2022-03-2223:53:58.211774: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:922] could not open file to read NUMA node: /sys/bus/pci/devices/0000:02:00.0/numa_node Your kernel may have been built without NUMA support. 2022-03-2223:53:58.216025: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:922] could not open file to read NUMA node: /sys/bus/pci/devices/0000:02:00.0/numa_node Your kernel may have been built without NUMA support. 2022-03-2223:53:58.216161: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1609] Could not identify NUMA node of platform GPU id 0, defaulting to 0. Your kernel may not have been built with NUMA support. 2022-03-2223:53:58.217104: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:922] could not open file to read NUMA node: /sys/bus/pci/devices/0000:02:00.0/numa_node Your kernel may have been built without NUMA support. 2022-03-2223:53:58.217737: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 3954 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1660 Ti with Max-Q Design, pci bus id: 0000:02:00.0, compute capability: 7.5 True [PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
Tue Mar 22 22:38:35 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 510.52 Driver Version: 511.79 CUDA Version: 11.6 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | ||| MIG M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... On | 00000000:02:00.0 Off | N/A | | 0% 41C P8 6W / N/A | 4412MiB / 6144MiB | 23% Default | ||| N/A | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 2400 C /python3.8 N/A | | 0 N/A N/A 32447 G /Xwayland N/A | +-----------------------------------------------------------------------------+