Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liyapeng
/
log_collect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 400b596a
authored
Dec 20, 2023
by
liyapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增获取GPU信息与slot对应关系的收集,写入到slot-info.txt文件
1 parent
fe08b55d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
log_collect.sh
log_collect.sh
View file @
400b596
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment