def _init(cls):
if cls._dll is None:
logger.trace('Loading NVIDIA ML library.')
try:
cls._dll = ctypes.CDLL(cls.NVIDIA_ML)
except OSError:
raise CudaError('Failed to find NVIDIA ML library.')
if not cls._ref:
logger.trace('Initializing NVIDIA ML.')
init = cls._get_ptr('nvmlInit_v2')
if init():
raise CudaError('Failed to initialize NVIDIA ML.')
cls._ref += 1
###########################################################################
评论列表
文章目录