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

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

Former-commit-id: a45849c9
parent baf2a426
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ import os
import json
try:
#run nvidia-smi -L to parse output
#run nvidia-smi -L to parse output
p = subprocess.Popen(['nvidia-smi', '-L'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
......@@ -48,9 +48,9 @@ try:
if os.path.exists(devicePath):
#print "OK"
deviceList.append( { 'name':'gpu' , 'file': devicePath, 'type':typeOfDevice } )
else:
#print "Error file not found ",devicePath
sys.exit(0)
else:
print("error looking for nvidia device")
sys.exit(1)
#now convert list to json
output=json.dumps(deviceList)
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