MxInit
Function Usage
Performs global initialization such as allocating device and log resources. After all Vision SDK APIs are executed, call MxDeInit() to deinitialize the initialized global resources. For details, see Initialization and Deinitialization.
- For the
Atlas 200/300/500 inference product andAtlas 200I/500 A2 inference product , use MxInit(). - For the Atlas inference product, all function prototypes of MxInit can be used. After MxInit() is called, the DVPP resource pool will be initialized when APIs of ImageProcessor and TensorOperations are called for the first time. When the APIs are called again, the DVPP resource pool is directly used. The size of the DVPP resource pool can be set by calling globalCfg or globalCfgExtra. When APIs of ImageProcessor and TensorOperations are called for the first time, it takes a longer time because the DVPP resource pool needs to be initialized.
- For the Atlas 800I A2 inference server, all function prototypes of MxInit can be used. After MxInit() is called, the DVPP resource pool can be directly used. The size of pool can be set by calling globalCfg or globalCfgExtra.
- MxInit can be called only once per process.
- The underlying channel resources requested by the DVPP resource pool are shared by processes. In multi-process scenarios, resources may be exhausted. Therefore, exercise caution when using the DVPP resource pool.
- The DVPP resource pool shares bottom-layer channel resources with VideoEncoder and VideoDecoder. In extreme scenarios, resources may be used up. You are advised to initialize the resource pool size based on the actual situation.
- This API registers the threads for monitoring the number of logs and log time. The threads are named log_filenum and log_time respectively.
Prototype
1 | APP_ERROR MxInit(); |
1 | APP_ERROR MxInit(const AppGlobalCfg &globalCfg); |
1 | APP_ERROR MxInit(const AppGlobalCfgExtra &globalCfgExtra); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
globalCfg |
Input |
AppGlobalCfg type that applies to global configuration. |
globalCfgExtra |
Input |
AppGlobalCfgExtra type that applies to global configuration. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |
Parent topic: Initialization and Deinitialization