def check_so(soname):
"""
Verify that we do have the 'soname' lib present in the system, and that it
can be loaded.
"""
if len(get_available_gpus()) == 0:
return None
# Try to force load lib, this would fail if the lib is not there :)
try:
lib = cdll.LoadLibrary(soname)
print("INFO: Found so as", lib)
assert lib.__class__.__name__ == 'CDLL'
assert lib._name == soname
return True
except OSError as ex:
print("WARNING:", ex)
return False
评论列表
文章目录