ASCEND_RT_VISIBLE_DEVICES

Description

Specifies the devices that are visible to the current process. One or more device IDs can be specified at a time. By using this environment variable, you can adjust the devices without modifying the application.

Device ID indicates the logical ID of the AI processor. For example, if the number of available devices is 8, the device IDs are 0, 1, 2, 3, 4, 5, 6, and 7. The application scenarios are as follows:

  • This environment variable is for trial use and may be changed in later versions. Therefore, do not use it in production.
  • Only specified device IDs can be configured in ascending order.
  • This environment variable cannot be used when the DCMI APIs are used. For details about the DCMI APIs, see DCMI API Reference.
  • This environment variable cannot be used when the HCCN Tool APIs are used. For details about the HCCN Tool APIs, see HCCN Tool API Reference.
  • This environment variable cannot be used when the profiling function is enabled.

Use cases:

Execute the offline inference program.

The TensorFlow/PyTorch framework network performs training or online inference on the Ascend platform.

Example

Restrictions

In the scenario where the TensorFlow framework network performs training or online inference on the Ascend platform, the priority of the ASCEND_RT_VISIBLE_DEVICES environment variable is higher than that of ASCEND_DEVICE_ID. If ASCEND_DEVICE_ID and ASCEND_RT_VISIBLE_DEVICES are used together, ASCEND_DEVICE_ID can be set only to the device index value in ASCEND_RT_VISIBLE_DEVICES. Otherwise, the training or inference application runs abnormally.

Applicable Models

Ascend 950PR/Ascend 950DT

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products