Skip to content

Commit bdc54a4

Browse files
committed
fixed list gpu logic errors
1 parent bcc0714 commit bdc54a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nvdocker/nvdocker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def exec_run(self, cid, cmd):
153153
@staticmethod
154154
def list_gpus():
155155
#output = check_output(["nvidia-smi", "-L"]).decode("utf-8")
156-
query_gpu = check_output(["nvidia-smi", "--query-gpu=memory.free,memory.used,memory.total --format=csv,noheader"]).decode("utf-8");
156+
query_gpu = check_output(["nvidia-smi", "--query-gpu=memory.free,memory.used,memory.total","--format=csv,noheader"]).decode("utf-8");
157157
#regex = re.compile(r"GPU (?P<id>\d+):")
158158
gpus = {}
159159
id = 0;
@@ -162,6 +162,7 @@ def list_gpus():
162162
for info in gpu:
163163
gpu_info.append(info.split(" ")[0]);
164164
gpus[id] = gpu_info;
165+
id += 1
165166
return gpus
166167

167168
@staticmethod

0 commit comments

Comments
 (0)