Skip to content

Commit a13cd73

Browse files
committed
Normal exit when no gpu is detected
1 parent b6b200a commit a13cd73

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/nvidiacc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525

2626
def CommaSeparatedCCString():
27+
unknown_cc = 'UnknownCC'
28+
2729
libnames = ('libcuda.so', 'libcuda.dylib', 'nvcuda.dll', 'cuda.dll')
2830
for libname in libnames:
2931
try:
@@ -33,7 +35,7 @@ def CommaSeparatedCCString():
3335
else:
3436
break
3537
else:
36-
raise OSError('could not load any of: ' + ' '.join(libnames))
38+
return unknown_cc
3739

3840
############################################################
3941

@@ -83,8 +85,8 @@ def checkCall(f, *args):
8385
cc_str = cc_str + ',{}'.format(cc_list[i])
8486
return cc_str
8587
else:
86-
return ''
88+
return unknown_cc
8789

8890

8991
if __name__ == '__main__':
90-
print(CommaSeparatedCCString())
92+
print(CommaSeparatedCCString(), end='')

0 commit comments

Comments
 (0)