How Do I Obtain Logs Generated During aclnn API Calling?

If an operator fails to be executed or the precision is abnormal during the calling of the aclnn API, you can extract the host logs for analysis and determination. Generally, the following log information needs to be analyzed:

  • Obtaining plogs:

    After the program is executed, you can view the logs in $HOME/ascendc/log by default. The path for storing the host log file is as follows:

    1
    $HOME/ascend/log/debug/plog/plog-pid_*.log
    

    You can enable the environment variable ASCEND_SLOG_PRINT_TO_STDOUT to display logs on the screen. (1: enabled; 0: disabled). A configuration example is as follows:

    1
    export ASCEND_SLOG_PRINT_TO_STDOUT=1
    

    For details about logs, see Log Reference. For details about environment variables, see Environment Variables.

  • Obtaining aclnn error information:

    Obtain the exception information during the aclnn API call through the aclGetRecentErrMsg API. The method is as follows:

    1
    printf(aclGetRecentErrMsg());
    

    The following is an example of the printed error information:

    1
    [PID:646612] 2026-01-24-11:53:44.671.727 AclNN_Parameter_Error(EZ1001): Expected a proper Tensor but got null for argument addmmTennsor.self.