我要评分
获取效率
正确性
完整性
易理解

Querying the Thread IDs

Before binding cores, query the IDs of the main process and AscendCL threads.

  • Query the main process ID in the NPU information. If the inference service is executed in a container, run the following commands in the container:
    THDNAME="acl_thread"
    THREADS=`ps -Te | grep ${THDNAME} | grep -v grep | awk '!a[$1]++' | awk '{print $1}'`
    Display the NPU process ID.
    echo $THREADS

  • Query the AscendCL thread ID.
    for THREAD_ID in ${ THREADS[@]}
    do
        ACL=`ps -Te | grep ${THREAD_ID} | grep acl_thread | grep -v grep | awk '!a[$1]++' | awk '{print $2}'`
    done
    Display the AscendCL thread ID.
    echo $ACL