forked from srinivamd/rocminstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrocm_techsupport.sh
executable file
·290 lines (259 loc) · 10.9 KB
/
rocm_techsupport.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#!/bin/sh
# Copyright (c) 2020 Advanced Micro Devices, Inc. All Rights Reserved.
#
# rocm_techsupport.sh
# This script collects ROCm and system logs on a Debian OS installation.
# It requires 'sudo' supervisor privileges for some log collection
# such as dmidecode, dmesg, lspci -vvv to read capabilities.
# Author: [email protected]
# Revision: V1.23
# V1.23: add 4.0 check
# V1.22: workaround ROCm 3.9 rocm-smi bug
# V1.21: fix 3.10 detect
# V1.20: check openmp-extras package install
# V1.19: support for 3.10 release
# V1.18: add pnp filter
# V1.17: dump pids /sys/class/kfd/kfd/proc/
# V1.16: Add nmi to grep, lspci -t
# V1.15: Add rdc ROCm package filter, env, ldcache
# V1.14: List PCIe current link width/speed
# V1.12: List available ROCm versions under /opt
# V1.11: Run dmesg in addition to journalctl
# V1.10: get ROCm related ldconf entries
# V1.9: Add kfd to message filter
# V1.8: Add vfio to message filter
# V1.7: Check persistent logging status
# add panic, oop, fail, xgmi to grep filter
# V1.6: In docker, use dmesg
# V1.5: Add error and fault to system log filter
# V1.4: Collect logs from the last 3 boots
# Add power to grep
# V1.3: Add rocm-bandwidth-test -t to get topology
# V1.2: Add ECC and rask_mask
# Show ras info, xgmierr
# V1.1: Detect OS type
# Check paths for lspci, lshw
# V1.0: Initial version
#
echo "=== ROCm TechSupport Log Collection Utility: V1.23 ==="
/bin/date
ret=`/bin/grep -i -E 'debian|ubuntu' /etc/os-release`
if [ $? -ne 0 ]
then
pkgtype="rpm"
else
pkgtype="deb"
fi
echo "===== Section: OS Distribution ==============="
# Print OS type
/bin/uname -a
# OS release
/bin/cat /etc/os-release
# Kernel boot parameters
echo "===== Section: Kernel Boot Parameters ==============="
/bin/cat /proc/cmdline
# System log related to GPU
echo "===== Section: dmesg GPU/DRM/ATOM/BIOS ==============="
if [ -f /var/log/journal ]
then
echo "Persistent logging enabled."
else
echo "WARNING: Persistent logging possibly disabled."
echo "WARNING: Please run: "
echo " sudo mkdir -p /var/log/journal "
echo " sudo systemctl restart systemd-journald.service "
echo "WARNING: to enable persistent boot logs for collection and analysis."
fi
dockerchk=`/bin/grep cpuset /proc/1/cgroup | /usr/bin/awk 'BEGIN {FS=":"} {print $3}'`
if [ "$dockerchk" != "/" ]
then
echo "Section: Current boot logs"
/bin/dmesg | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
elif [ -f /bin/journalctl ]
then
echo "Section: dmesg boot logs"
/bin/dmesg | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Current boot logs"
/bin/journalctl -b | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Previous boot logs"
/bin/journalctl -b -1 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Second Previous boot logs"
/bin/journalctl -b -2 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Third Previous boot logs"
/bin/journalctl -b -3 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
elif [ -f /usr/bin/journalctl ]
then
echo "Section: dmesg boot logs"
/bin/dmesg | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Current boot logs"
/usr/bin/journalctl -b | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Previous boot logs"
/usr/bin/journalctl -b -1 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Second Previous boot logs"
/usr/bin/journalctl -b -2 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "Section: Third Previous boot logs"
/usr/bin/journalctl -b -3 | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
else
echo "Section: dmesg boot logs"
/bin/dmesg | /bin/grep -i -E ' Linux v| Command line|power|pnp|pci|gpu|drm|error|xgmi|panic|nmi|dazed|oop|fail|fault|atom|bios|kfd|vfio|iommu|ras_mask|ECC|smpboot.*CPU|pcieport.*AER'
echo "ROCmTechSupportNotFound: journalctl utility not found!"
fi
# CPU information
echo "===== Section: CPU Information ==============="
/usr/bin/lscpu
# Memory information
echo "===== Section: Memory Information ==============="
/usr/bin/lsmem
# Hardware Information
echo "===== Section: Hardware Information ==============="
if [ -f /usr/bin/lshw ]
then
/usr/bin/lshw
elif [ -f /usr/sbin/lshw ]
then
/usr/sbin/lshw
elif [ -f /sbin/lshw ]
then
/sbin/lshw
else
echo "Note: Install lshw to get lshw hardware listing information"
echo " Ex: sudo apt install lshw "
echo "ROCmTechSupportNotFound: lshw utility not found!"
fi
# Kernel Modules loaded
echo "===== Section: lsmod loaded module ==============="
/sbin/lsmod
# amdgpu modinfo
echo "===== Section: amdgpu modinfo ==============="
/sbin/modinfo amdgpu
# Hardware Topology
echo "===== Section: Hardware Topology ==============="
if [ -f /usr/bin/lstopo-no-graphics ]
then
/usr/bin/lstopo-no-graphics
else
echo "lstopo command not found. Skipping hardware topology information."
echo "Note: Install hwloc to get lstopo hardware topology information"
echo " Ex: sudo apt install hwloc "
fi
# DMIdecode information - BIOS etc
echo "===== Section: dmidecode Information ==============="
/usr/sbin/dmidecode
# PCI peripheral information
echo "===== Section: lspci verbose output ==============="
if [ -f /usr/bin/lspci ]
then
/usr/bin/lspci -vvvt
/usr/bin/lspci -vvv
elif [ -f /usr/sbin/lspci ]
then
/usr/sbin/lspci -vvvt
/usr/sbin/lspci -vvv
elif [ -f /sbin/lspci ]
then
/sbin/lspci -vvvt
/sbin/lspci -vvv
else
echo "ROCmTechSupportNotFound: lspci utility not found!"
fi
# Print ROCm installed packages
echo "===== Section: ROCm Packages Installed ==============="
if [ "$pkgtype" = "deb" ]
then
/usr/bin/dpkg -l | /bin/grep -i -E 'ocl-icd|kfdtest|llvm-amd|miopen|half|^ii hip|hcc|hsa|rocm|atmi|^ii comgr|aomp|rock|mivision|migraph|rocprofiler|roctracer|rocbl|hipify|rocsol|rocthr|rocff|rocalu|rocprim|rocrand|rccl|rocspar|rdc|openmp' | /usr/bin/sort
else
/usr/bin/rpm -qa | /bin/grep -i -E 'ocl-icd|kfdtest|llvm-amd|miopen|half|hip|hcc|hsa|rocm|atmi|comgr|aomp|rock|mivision|migraph|rocprofiler|roctracer|rocblas|hipify|rocsol|rocthr|rocff|rocalu|rocprim|rocrand|rccl|rocspar|rdc|openmp' | /usr/bin/sort
fi
# Log ROCm related ldconfig entries
echo "===== Section: ROCm ldconfig entries ==============="
/bin/grep -i 'rocm' /etc/ld.so.conf.d/*
# Dump ROCm cached ldconfig entries
echo "===== Section: ROCm ldcache entries ============="
ldconfig -p | grep rocm
# Dump ROCm related environmental variables
echo "===== Section: ROCm environment variables============="
env | /bin/grep -i 'rocm'
# Select latest ROCM installed version: only supports 3.1 or newer
echo "===== Section: Available ROCm versions ==============="
/bin/ls -v -d /opt/rocm*
ROCM_VERSION=`/bin/ls -v -d /opt/rocm-[3-4]* | /usr/bin/tail -1`
if [ "$ROCM_VERSION"x = "x" ]
then
ROCM_VERSION=`/bin/ls -v -d /opt/rocm* | /usr/bin/tail -1`
fi
echo "==== Using $ROCM_VERSION to collect ROCm information.==== "
# RBT Topology
echo "===== Section: rocm-bandwidth-test Topology ==============="
if [ -f $ROCM_VERSION/bin/rocm-bandwidth-test ]
then
$ROCM_VERSION/bin/rocm-bandwidth-test -t
else
echo "$ROCM_VERSION/bin/rocm-bandwidth-test command not found. Skipping topology information."
echo "Note: Install rocb=m-bandwidth-test ROCm package to get topology information"
echo " Ex: sudo apt install rocm-bandwidth-test "
fi
# ROCm SMI
echo "===== Section: ROCm SMI ==============="
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi
else
echo " $ROCM_VERSION/bin/rocm-smi NOT FOUND !!! "
fi
# ROCm SMI - FW version
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
echo "===== Section: ROCm SMI showhw ==============="
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi --showhw
fi
# ROCm PCIe Clock
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
echo "===== Section: ROCm SMI pcieclk clock ==============="
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi -c | /bin/grep "pcie"
fi
echo "===== Section: GPU PCIe Link Config ==============="
for i in $(seq 0 8)
do
echo "GPU $i PCIe Link Width Speed: "
cat /sys/class/drm/card$i/device/current_link_width
cat /sys/class/drm/card$i/device/current_link_speed
done
echo "===== Section: KFD PIDs sysfs kfd proc ==============="
ls /sys/class/kfd/kfd/proc/
# ROCm SMI - RAS info
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
echo "===== Section: ROCm SMI showrasinfo all==============="
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi --showrasinfo all
fi
# ROCm SMI - xgmierr
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
echo "===== Section: ROCm SMI showxgmierr ==============="
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi --showxgmierr
fi
# ROCm SMI - FW version clocks etc.
if [ -f $ROCM_VERSION/bin/rocm-smi ]
then
echo "===== Section: ROCm SMI clocks ==============="
LD_LIBRARY_PATH=$ROCM_VERSION/lib:$LD_LIBRARY_PATH $ROCM_VERSION/bin/rocm-smi -cga
fi
# ROCm Agent Information
if [ -f $ROCM_VERSION/bin/rocminfo ]
then
echo "===== Section: rocminfo ==============="
$ROCM_VERSION/bin/rocminfo
fi
# OpenCL Agent Information
if [ -f $ROCM_VERSION/opencl/bin/x86_64/clinfo ]
then
echo "===== Section: clinfo ==============="
$ROCM_VERSION/opencl/bin/x86_64/clinfo
fi
# path in 3.5
if [ -f $ROCM_VERSION/opencl/bin/clinfo ]
then
echo "===== Section: clinfo ==============="
$ROCM_VERSION/opencl/bin/clinfo
fi