File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717singularity on pypi), and the versions here will coincide with these releases.
1818
1919## [ master] ( https://github.com/singularityhub/singularity-cli/tree/master )
20+ - adding nvidia flag as nv argument (with default False) to run/exec (0.0.41)
2021 - fixing bug in shell.py, cli should be client (0.0.40)
2122 - remove uri function should only right strip to support relative paths (0.0.39)
2223 - adjusting container build to use correct Github branch (vault/release-2.5)
Original file line number Diff line number Diff 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,17 @@ 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
49-
50+ nv: if True, load Nvidia Drivers in runtime (default False)
5051 '''
5152 from spython .utils import check_install
5253 check_install ()
5354
5455 cmd = self ._init_command ('exec' )
5556
57+ # nv option leverages any GPU cards
58+ if nv is True :
59+ cmd += ['--nv' ]
60+
5661 # If the image is given as a list, it's probably the command
5762 if isinstance (image , list ):
5863 command = image
Original file line number Diff line number Diff 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 (default False)
5152 '''
5253 from spython .utils import check_install
5354 check_install ()
5455
5556 cmd = self ._init_command ('run' )
57+
58+ # nv option leverages any GPU cards
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 :
Original file line number Diff line number Diff line change 1818
1919
2020
21- __version__ = "0.0.40 "
21+ __version__ = "0.0.41 "
2222AUTHOR = 'Vanessa Sochat'
2323AUTHOR_EMAIL = '[email protected] ' 2424NAME = 'spython'
You can’t perform that action at this time.
0 commit comments