Initialization and Cleanup
- Provided by: nvidia-cuda-dev (Version: 10.1.243-3)
- Source: nvidia-cuda-toolkit
- Report a bug
nvmlReturn_t DECLDIR nvmlInit (void)
nvmlReturn_t DECLDIR nvmlInitWithFlags (unsigned int flags)
nvmlReturn_t DECLDIR nvmlShutdown (void)
This chapter describes the methods that handle NVML initialization and cleanup. It is the user's responsibility to call nvmlInit() before calling any other methods, and nvmlShutdown() once NVML is no longer being used.
Initialize NVML, but don't initialize any GPUs yet.
Note:
In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit'_v1' (default in NVML 4.304 and older) that did initialize all GPU devices in the system.
This allows NVML to communicate with a GPU when other GPUs in the system are unstable or in a bad state. When using this API, GPUs are discovered and initialized in nvmlDeviceGetHandleBy* functions instead.
Note:
For all products.
This method, should be called once before invoking any other methods in the library. A reference count of the number of initializations is maintained. Shutdown only occurs when the reference count reaches zero.
Returns:
nvmlInitWithFlags is a variant of nvmlInit(), that allows passing a set of boolean values modifying the behaviour of nvmlInit(). Other than the 'flags' parameter it is completely similar to nvmlInit.
For all products.
Parameters:
Returns:
Shut down NVML by releasing all GPU resources previously allocated with nvmlInit().
For all products.
This method should be called after NVML work is done, once for each call to nvmlInit() A reference count of the number of initializations is maintained. Shutdown only occurs when the reference count reaches zero. For backwards compatibility, no error is reported if nvmlShutdown() is called more times than nvmlInit().
Returns:
Generated automatically by Doxygen for NVML from the source code.