1.1.1. Init and Shutdown
[Administrative]
Describes APIs to Initialize and Shutdown the DCGM Engine.
Functions
- dcgmReturn_t dcgmConnect ( char* ipAddress, dcgmHandle_t* pDcgmHandle )
- dcgmReturn_t dcgmConnect_v2 ( char* ipAddress, dcgmConnectV2Params_t* connectParams, dcgmHandle_t* pDcgmHandle )
- dcgmReturn_t dcgmDisconnect ( dcgmHandle_t pDcgmHandle )
- dcgmReturn_t dcgmInit ( void )
- dcgmReturn_t dcgmShutdown ( void )
- dcgmReturn_t dcgmStartEmbedded ( dcgmOperationMode_t opMode, dcgmHandle_t* pDcgmHandle )
- dcgmReturn_t dcgmStartEmbedded_v2 ( dcgmStartEmbeddedV2Params_v1* params )
- dcgmReturn_t dcgmStopEmbedded ( dcgmHandle_t pDcgmHandle )
Functions
- dcgmReturn_t dcgmConnect ( char* ipAddress, dcgmHandle_t* pDcgmHandle )
-
Parameters
- ipAddress
- IN: Valid IP address for the remote host engine to connect to. If ipAddress is specified as x.x.x.x it will attempt to connect to the default port specified by DCGM_HE_PORT_NUMBER If ipAddress is specified as x.x.x.x:yyyy it will attempt to connect to the port specified by yyyy
- pDcgmHandle
- OUT: DCGM Handle of the remote host engine
Returns
- DCGM_ST_OK if we successfully connected to the remote host engine
- DCGM_ST_CONNECTION_NOT_VALID if the remote host engine could not be reached
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit.
- DCGM_ST_BADPARAM if pDcgmHandle is NULL or ipAddress is invalid
- DCGM_ST_INIT_ERROR if DCGM encountered an error while initializing the remote client library
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit
Description
This method is used to connect to a stand-alone host engine process. Remote host engines are started by running the nv-hostengine command.
NOTE: dcgmConnect_v2 provides additional connection options.
- dcgmReturn_t dcgmConnect_v2 ( char* ipAddress, dcgmConnectV2Params_t* connectParams, dcgmHandle_t* pDcgmHandle )
-
Parameters
- ipAddress
- IN: Valid IP address for the remote host engine to connect to. If ipAddress is specified as x.x.x.x it will attempt to connect to the default port specified by DCGM_HE_PORT_NUMBER. If ipAddress is specified as x.x.x.x:yyyy it will attempt to connect to the port specified by yyyy
- connectParams
- IN: Additional connection parameters. See dcgmConnectV2Params_t for details.
- pDcgmHandle
- OUT: DCGM Handle of the remote host engine
Returns
- DCGM_ST_OK if we successfully connected to the remote host engine
- DCGM_ST_CONNECTION_NOT_VALID if the remote host engine could not be reached
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit.
- DCGM_ST_BADPARAM if pDcgmHandle is NULL or ipAddress is invalid
- DCGM_ST_INIT_ERROR if DCGM encountered an error while initializing the remote client library
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit
Description
This method is used to connect to a stand-alone host engine process. Remote host engines are started by running the nv-hostengine command.
- dcgmReturn_t dcgmDisconnect ( dcgmHandle_t pDcgmHandle )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle that came from dcgmConnect
Returns
- DCGM_ST_OK if we successfully disconnected from the host engine
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit
- DCGM_ST_BADPARAM if pDcgmHandle is not a valid DCGM handle
- DCGM_ST_GENERIC_ERROR if an unspecified internal error occurred
Description
This method is used to disconnect from a stand-alone host engine process.
- dcgmReturn_t dcgmInit ( void )
-
Returns
- DCGM_ST_OK if DCGM has been properly initialized
- DCGM_ST_INIT_ERROR if there was an error initializing the library
Description
This method is used to initialize DCGM within this process. This must be called before dcgmStartEmbedded() or dcgmConnect()
*
- dcgmReturn_t dcgmShutdown ( void )
-
Returns
- DCGM_ST_OK if DCGM has been properly shut down
- DCGM_ST_UNINITIALIZED if the library was not shut down properly
Description
This method is used to shut down DCGM. Any embedded host engines or remote connections will automatically be shut down as well.
- dcgmReturn_t dcgmStartEmbedded ( dcgmOperationMode_t opMode, dcgmHandle_t* pDcgmHandle )
-
Parameters
- opMode
- IN: Collect data automatically or manually when asked by the user.
- pDcgmHandle
- OUT: DCGM Handle to use for API calls
Returns
- DCGM_ST_OK if DCGM was started successfully within our process
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit yet
Description
Start an embedded host engine agent within this process.
The agent is loaded as a shared library. This mode is provided to avoid any extra jitter associated with an additional autonomous agent needs to be managed. In this mode, the user has to periodically call APIs such as dcgmPolicyTrigger and dcgmUpdateAllFields which tells DCGM to wake up and perform data collection and operations needed for policy management.
- dcgmReturn_t dcgmStartEmbedded_v2 ( dcgmStartEmbeddedV2Params_v1* params )
-
Parameters
- params
- IN/OUT: See dcgmStartEmbeddedV2Params_v1 for details.
Returns
- DCGM_ST_OK if DCGM was started successfully within our process
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit yet
Description
Start an embedded host engine agent within this process.
The agent is loaded as a shared library. This mode is provided to avoid any extra jitter associated with an additional autonomous agent needs to be managed. In this mode, the user has to periodically call APIs such as dcgmPolicyTrigger and dcgmUpdateAllFields which tells DCGM to wake up and perform data collection and operations needed for policy management.
- dcgmReturn_t dcgmStopEmbedded ( dcgmHandle_t pDcgmHandle )
-
Parameters
- pDcgmHandle
- IN : DCGM Handle of the embedded host engine that came from dcgmStartEmbedded
Returns
- DCGM_ST_OK if DCGM was stopped successfully within our process
- DCGM_ST_UNINITIALIZED if DCGM has not been initialized with dcgmInit or the embedded host engine was not running.
- DCGM_ST_BADPARAM if an invalid parameter was provided
- DCGM_ST_INIT_ERROR if an error occurred while trying to start the host engine.
Description
Stop the embedded host engine within this process that was started with dcgmStartEmbedded