Commit 400b596a by liyapeng

新增获取GPU信息与slot对应关系的收集,写入到slot-info.txt文件

1 parent fe08b55d
Showing with 11 additions and 0 deletions
......@@ -73,6 +73,17 @@ GPULogCollect() {
lspci -vvv -t >>${LOG_FILE_PATH}/GPULogCollect/lspci-nvidia.log
lspci -vvv >>${LOG_FILE_PATH}/GPULogCollect/lspci-nvidia.log
dmesg -T >${LOG_FILE_PATH}/GPULogCollect/dmesg-gpu.log
# get slot info
touch ${LOG_FILE_PATH}/GPULogCollect/slot-info.txt
nvidia-smi --query-gpu=index,gpu_name,gpu_bus_id,uuid --format=csv > ${LOG_FILE_PATH}/GPULogCollect/slot-info.txt
sed -i "s/^/${HOSTNAME}, &/g" ${LOG_FILE_PATH}/GPULogCollect/slot-info.txt
for line in $(cat ${LOG_FILE_PATH}/GPULogCollect/slot-info.txt | awk -F , '{print $4}')
do
BUSID=${line: -12}
SLOT=$(dmidecode -t slot | grep -E "Designation|Bus Address" | grep -B 1 -i ${BUSID} | grep Designation | awk -F \: '{print $2}')
sed -i "s/${BUSID}/${BUSID}, ${SLOT}/g" ${LOG_FILE_PATH}/GPULogCollect/slot-info.txt
done
wait
fi
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!