mxnet和tens中的gpu顺序错误

2022-12-01 05:37:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我的桌面上安装了2个gpu:1080和1080Ti nvidiasmi显示gpu-0是1080,gpu-1是1080Ti

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.79       Driver Version: 410.79       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| 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 1080    Off  | 00000000:01:00.0 Off |                  N/A |
| 26%   57C    P2    53W / 215W |    696MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 108...  Off  | 00000000:02:00.0 Off |                  N/A |
| 55%   70C    P2   204W / 250W |   8641MiB / 11178MiB |     28%      Default |
+-------------------------------+----------------------+----------------------+

现在tensorflowmxnet都使用相反的顺序:指定gpu=0时为1080ti,指定gpu=1时为1080。你知道吗

为什么会发生这种情况,以及如何将tensorflow和mxnet gpu订单与nvidia smi gpu订单同步?

mxnet的代码段:

mod = mx.mod.Module(symbol, label_names=None, context=mx.gpu(0))

对于tensorflow,我使用环境变量

CUDA_VISIBLE_DEVICES="0"   

Tags: 订单moddefaultgpuversiontensorflowusagemxnetcudap2mxoffgtxgeforce