GPU management and access API.
For related information, see Discrete GPU in the Development Guide.
General usage notes:
- This library uses object-oriented design. In general, objects are referred by handles.
- When destroying an object, the child objects are not destroyed by default. Additionally, it is an error to destroy a parent before its child.
- In object creation, the attribute pointer (where applicable) can always be NULL, which indicates defaults.
- In object creation, the first parameter specifies the parent. Some objects may be created for parents of different types.
- Whenever a function that returns a new handle is invoked, the handle is guaranteed to be unique as well as the object it points to. There will be 1-to-1 mapping between handles and objects.
- It is a fatal error to provide unexpected handle type. That will produce either an assert (debug builds) or undefined behavior (release builds)
- In general, the const pointers returned by functions are valid as long as the related object is valid, unless otherwise stated. And in particular, they shall not be freed by the caller. For example, the device list returned by NvRmGpuLibListDevices() is valid until the lib handle is closed.
- This library is thread-safe with the following rule: an object can be closed only if there are no concurrent operations on-going on it. Attempting to close an object during an on-going operation is a fatal error.