我有两个GPU,CUDA和TensorFlow正常工作,nvidia-smi
结果
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24.02 Driver Version: 396.24.02 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX TIT... Off | 00000000:01:00.0 On | N/A |
| 29% 46C P8 16W / 250W | 113MiB / 6080MiB | 1% Default |
+-------------------------------+----------------------+----------------------+
| 1 P104-100 Off | 00000000:04:00.0 Off | N/A |
| 37% 43C P8 8W / 180W | 0MiB / 4042MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
但是即使在简单的情况下,我在使用PyCuda时也会遇到一些麻烦
from pycuda import driver as drv
drv.init()
我收到一个错误pycuda._driver.LogicError: cuInit failed: invalid device ordinal
。
谁能帮我-这可能是什么问题?