Skip to content

Commit 0dd68be

Browse files
committed
alpha 3
1 parent 39315ce commit 0dd68be

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

nvdocker/nvdocker.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,23 @@ def run(self, image, cmd="", **kwargs):
6969
#defaults
7070
config = {}
7171
environment = {}
72-
for arg in kwargs:
72+
for arg in kwargs:
7373
if arg == "driver_capabilities":
7474
environment["NVIDIA_DRIVER_CAPABILITIES"] = kwargs["driver_capabilities"]
7575
elif arg == "visible_devices" in kwargs:
76-
environment["NVIDIA_VISIBLE_DEVICES"] = kwargs["visible_devices"]
76+
vis_devices = ""
77+
if type(kwargs["visible_devices"]) is list:
78+
if len(kwargs["visible_devices"]) == 1:
79+
vis_devices = str(kwargs["visible_devices"][0])
80+
else:
81+
for dev in kwargs["visible_devices"]:
82+
vis_devices += dev + ','
83+
vis_devices = vis_devices[:-1]
84+
elif type(kwargs["visible_devices"]) is str:
85+
vis_devices = kwargs["visible_device"]
86+
elif type(kwargs["visible_devices"]) is int:
87+
vis_devices = str(kwargs["visible_devices"])
88+
environment["NVIDIA_VISIBLE_DEVICES"] = vis_devices
7789
elif arg == "disable_require" in kwargs:
7890
environment["NVIDIA_DISABLE_REQUIRE"] = kwargs["disable_require"]
7991
elif arg == "require":

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = nvdocker
3-
version = 0.0.2a2
3+
version = 0.0.2a3
44
author = ACM@UIUC
55
author-email = acm@illinois.edu
66
summary = Python interface for NVIDIA Docker

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='nvdocker',
15-
version='0.0.2a2',
15+
version='0.0.2a3',
1616
description='nvdocker is library built on top of the docker-py python sdk to build and run docker containers using nvidia-docker. Targets nvidia-docker2',
1717
long_description=long_description,
1818
url='https://github.com/acm-uiuc/nvdocker',

0 commit comments

Comments
 (0)