Before the system enters the hibernation mode, ensure that services such as AI inference and media data processing are not delivered, or exit service processes. After the system is woken up successfully, continue to deliver services or restart service processes.
Processes
Do not use the fork function and functions that encapsulate fork (such as system and posix_spawnp) to create multiple acl API caller processes, as this may lead to errors or cause processes to stop responding at runtime.
Atlas training products
: For physical machines, a device supports a maximum of 64 user processes, and a host supports a maximum of 64 processes multiplied by the number of devices. For virtual machines, a device supports a maximum of 32 user processes, and a host supports a maximum of 32 processes multiplied by the number of devices.
Atlas inference products
: For physical machines, a device supports a maximum of 64 user processes, and a host supports a maximum of 64 processes multiplied by the number of devices. For virtual machines, a device supports a maximum of 32 user processes, and a host supports a maximum of 32 processes multiplied by the number of devices.
Atlas 200I/500 A2 inference products
: A device supports a maximum of 64 user processes, and a host supports a maximum of 64 processes multiplied by the number of devices.
Atlas A2 training products
/
Atlas A2 inference products
: A device supports a maximum of 63 user processes, and a host supports a maximum of 63 processes multiplied by the number of devices.
Atlas A3 training products
/
Atlas A3 inference products
: A device supports a maximum of 63 user processes, and a host supports a maximum of 63 processes multiplied by the number of devices.
Allocation and deallocation APIs
Use the allocation and deallocation APIs in pairs (for example, the aclrtCreateStream and aclrtDestroyStream pair, the aclrtCreateEvent and aclrtDestroyEvent pair, and the aclCreateDataBuffer and aclDestroyDataBuffer pair). Ensure that any allocations that are no longer needed are destroyed in a timely manner, as failure to do so may impact the app's ability to function properly.
Once a deallocation API (such as aclrtDestroyStream, aclrtDestroyEvent, aclrtFree, or aclDestroyDataBuffer) is called, the allocation is destroyed and is no longer available. Consequently, it is a good practice to set the allocation to an invalid value (for example, NULL) in subsequent API calls.
Memory
When developing service applications on
Atlas inference products
, concurrent writes to the same memory address must be avoided, as such operations may trigger hardware exceptions.
Do not use fork or fork-encapsulated functions (such as system and posix_spawnp) for asynchronous memory manipulations (by using calls to APIs such as aclrtMemcpyAsync and aclrtMemsetAsync). Doing so may result in unexpected errors at runtime and may possibly cause the process to stop responding.
After memory is allocated by a call to a memory allocation API (such as aclrtMalloc) and before you use the allocated memory, you are advised to first use the aclrtMemset or aclrtMemsetAsync call to initialize the memory, for example, aclrtMemset(devBufferPtr, devBufferSize, 0, devBufferSize).
In Ascend RC mode, the aclrtMalloc, acldvppMalloc, and hi_mpi_dvpp_malloc memory management APIs are called in the app logic, and the app runs on the device, the app is suspended in the event of memory insufficiency until memory is available. You can activate some configurations (for example, enable_oom_killer) provided by the OS as required. In this way, the app automatically exits when the memory is insufficient.
To activate enable_oom_killer, log in to the device, go to the /proc/sys/vm directory, and set enable_oom_killer as the root user. The following is a command example, where 1 indicates activated, and 0 indicates deactivated.
echo 1 > enable_oom_killer
App migration from an earlier Ascend AI Processor to a new Ascend AI Processor
You need to convert the model and build the app again on the target Ascend AI Processor. Otherwise, app execution may be abnormal.