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}'` doneDisplay the AscendCL thread ID.echo $ACL

Parent topic: Reference Example