Skip to content

Commit a59c3d4

Browse files
authored
Update execute.py
1 parent f285629 commit a59c3d4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spython/main/execute.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def execute(self,
3030
writable = False,
3131
contain = False,
3232
bind = None,
33-
stream = False):
33+
stream=False,
34+
nv=False):
3435

3536
''' execute: send a command to a container
3637
@@ -46,13 +47,18 @@ def execute(self,
4647
bind: list or single string of bind paths.
4748
This option allows you to map directories on your host system to
4849
directories within your container using bind mounts
50+
nv: if True, load Nvidia Drivers in Runtime.
4951
5052
'''
5153
from spython.utils import check_install
5254
check_install()
5355

5456
cmd = self._init_command('exec')
5557

58+
# It option leverage the GPU card
59+
if nv is True:
60+
cmd += ['--nv']
61+
5662
# If the image is given as a list, it's probably the command
5763
if isinstance(image, list):
5864
command = image

0 commit comments

Comments
 (0)