Skip to content

Commit 9f1dde2

Browse files
authored
Update run.py
1 parent a59c3d4 commit 9f1dde2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spython/main/run.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def run(self,
2929
writable = False,
3030
contain = False,
3131
bind = None,
32-
stream = False):
32+
stream=False,
33+
nv=False):
3334

3435
'''
3536
run will run the container, with or withour arguments (which
@@ -47,12 +48,16 @@ def run(self,
4748
This option allows you to map directories on your host system to
4849
directories within your container using bind mounts
4950
stream: if True, return <generator> for the user to run
50-
51+
nv: if True, load Nvidia Drivers in Runtime.
5152
'''
5253
from spython.utils import check_install
5354
check_install()
5455

5556
cmd = self._init_command('run')
57+
58+
# It option leverage the GPU card
59+
if nv is True:
60+
cmd += ['--nv']
5661

5762
# No image provided, default to use the client's loaded image
5863
if image is None:

0 commit comments

Comments
 (0)