Skip to content
Snippets Groups Projects
Commit a45849c9 authored by Chris Hines's avatar Chris Hines
Browse files

nvidia-probe.py should exit 1 if there is an error

parent 7daaf1a0
No related branches found
No related tags found
1 merge request!181Fix gres.conf
...@@ -23,7 +23,7 @@ import os ...@@ -23,7 +23,7 @@ import os
import json import json
try: try:
#run nvidia-smi -L to parse output #run nvidia-smi -L to parse output
p = subprocess.Popen(['nvidia-smi', '-L'], stdout=subprocess.PIPE, p = subprocess.Popen(['nvidia-smi', '-L'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
out, err = p.communicate() out, err = p.communicate()
...@@ -48,9 +48,9 @@ try: ...@@ -48,9 +48,9 @@ try:
if os.path.exists(devicePath): if os.path.exists(devicePath):
#print "OK" #print "OK"
deviceList.append( { 'name':'gpu' , 'file': devicePath, 'type':typeOfDevice } ) deviceList.append( { 'name':'gpu' , 'file': devicePath, 'type':typeOfDevice } )
else: else:
#print "Error file not found ",devicePath print("error looking for nvidia device")
sys.exit(0) sys.exit(1)
#now convert list to json #now convert list to json
output=json.dumps(deviceList) output=json.dumps(deviceList)
print output print output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment