def _load_cudart():
system = platform.system()
lib_name = 'libcudart.' + ('dylib' if system == 'Darwin' else 'so')
lib_paths = [
lib_name,
os.path.join(torch._C._cuda_getLibPath(), lib_name),
os.path.join('/usr/local/cuda/lib64', lib_name),
os.path.join('/usr/local/cuda/lib', lib_name),
]
for path in lib_paths:
try:
return ctypes.cdll.LoadLibrary(path)
except OSError:
pass
raise RuntimeError("couldn't find libcudart. Make sure CUDA libraries "
"are installed in a default location, or that they're in " +
("DYLD_LIBRARY_PATH" if system == 'Darwin' else "LD_LIBRARY_PATH") +
".")
评论列表
文章目录