Viewing Logs (
Ascend EP
)
This section describes log file storage paths and main information recorded in log files in the
Viewing App Logs
App logs record logs generated during app execution. For example, after the AscendCL app is executed, you can view its logs in $HOME/ascend/log by default, as shown in Figure 1. For details, see Table 1.
- App logs can be viewed in containers or on physical machines. To ensure that the log tool runs properly in the container, you need to map the path of the dynamic library file libascendalog.so and the path of libc_sec.so which libascendalog.so depends on to the container. The paths are CANN installation path/ascend-toolkit/latest/compiler/lib64/libascendalog.so and CANN installation path/ascend-toolkit/driver/lib64/common/libc_sec.so.
- Device-side app logs are automatically transferred to the host. If the transfer fails, the logs are directly flushed to the device. If the transfer is successful, the logs are not flushed to the device.
- App logs can be aged. If the number or size of log files exceeds the threshold, the earliest log directories or files are automatically deleted.
Other related configurations:
- Change the path for flushing app logs. You can use the environment variable ASCEND_PROCESS_LOG_PATH to specify a log flush path. If you want the files generated during compilation and running to be flushed to a unified path, you can use ASCEND_WORK_PATH to set the path for storing files exclusively used by a single node.
- Set the delay for transferring device-side app logs. In the
Ascend EP standard form, the device-side slogd process automatically transfers device-side app logs to the host so that users can directly view such logs on the host. Before the service process exits, there is a default delay of 2000 ms for the system to transfer the app logs from the device to the host. The service process exits when the session times out. Logs that are not transferred to the host are directly flushed to the device. You can use the environment variable ASCEND_LOG_DEVICE_FLUSH_TIMEOUT to set a longer delay for transferring device-side app logs to the host. - Set the number of log files of each process stored in each app log directory (plog and device-id). By default, only 10 log files transferred to the host can be stored in the plog or device-id log directory per process. The number of saved log files can be set by using the environment variable ASCEND_HOST_LOG_FILE_NUM.
- Specify the log congestion handling mode. When log congestion occurs or the I/O access performance is poor, the system may lose logs to ensure that the service performance does not deteriorate. To facilitate fault locating, you can use ASCEND_LOG_SYNC_SAVE to prevent log loss in the case of log congestion or poor I/O access performance.
- Set the log display mode. By default, logs are saved to log files. If you need to print logs, you can configure the environment variable ASCEND_SLOG_PRINT_TO_STDOUT After the log printing function is enabled, you can also save logs to a specified file in output redirection mode when starting the application process. An example is ./main > log.txt.
Viewing System Logs
System logs record system running information. In the
- It is not supported to view or export device-side system logs (by using the msnpureport tool) in containers.
- System logs can be aged. If the number or size of log files exceeds the threshold, the earliest log directories or files are automatically deleted.
