File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 3737 default = '/tmp' ,
3838 help = 'Directory to mount read-write as /dst inside the container' ,
3939)
40+ parser .add_argument (
41+ '--gpus' ,
42+ metavar = 'GPU' ,
43+ help = 'docker run --gpus argument' ,
44+ )
4045parser .add_argument (
4146 'script' ,
4247 metavar = 'SCRIPT' ,
@@ -117,6 +122,8 @@ def run(args: argparse.Namespace) -> None:
117122 '--volume' ,
118123 f'{ os .path .abspath (args .dst )} :/dst:rw' ,
119124 ]
125+ if args .gpus is not None :
126+ run_cmd = run_cmd + ['--gpus' , args .gpus ]
120127 if args .script :
121128 run_cmd = run_cmd + [
122129 '--volume' ,
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ python3 setup.py bdist_wheel
2626
2727find . -name ' *.whl' > requirements.txt
2828# import torchspase fails without GPU device
29- /build/test.sh requirements.txt ' print()' # 'import torchsparse.backend; "count_cuda" in torchsparse.backend.__dict__'
29+ if [ -e /dev/nvidiactl ]; then
30+ /build/test.sh requirements.txt ' import torchsparse.backend; "count_cuda" in torchsparse.backend.__dict__'
31+ else
32+ echo ' GPU not found, add "--gpus all"'
33+ fi
3034
3135find . -name ' *.whl' -exec cp {} /dst \;
You can’t perform that action at this time.
0 commit comments