-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.sh
More file actions
354 lines (317 loc) · 14 KB
/
menu.sh
File metadata and controls
354 lines (317 loc) · 14 KB
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
#!/bin/bash
## This script is desiged to help a Server Engineer Test, Diagnose and Gather Logs from the Nvidia DGX-2 DiagOS
## The script will prompt the user for what testing they would like to perform. Runs the tests and upon completion will package then upload the test results to a FTP Server
## The log file can also be uploaded to another server with SCP or your favorite transport protocol
ftp_server="4.4.4.4/logs/"
SerNum=$(sudo dmidecode -s system-serial-number)
dt=$(date '+%d.%m.%Y.%H.%M')
host=$(hostname)
gpumemFunc () {
echo "Starting GPU Memory Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test gpumem
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
gpuperFunc () {
echo "Starting GPU Performance Switch Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test gpuperfswitch
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
cudacoresFunc () {
echo "Starting Cuda Core Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test cudacores
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
nvlinkFunc () {
echo "Starting NVLink Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test nvlink
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
nvswitchFunc () {
echo "Starting NV Switch Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test nvswitch
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
gpustressFunc () {
echo "Starting GPU Stress Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test gpustress
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
pcieFunc () {
echo "Starting PCIe Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test pcie
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
powerFunc () {
echo "Starting Power Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test power
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
gpuheatFunc () {
echo "Starting GPU Heat Sink Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test gpuheatsink
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
videoFunc () {
echo "Starting Video Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test video
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
connFunc () {
echo "Starting the Connectivity Test, please wait..."
sudo ./fieldiag.sh --run_on_error --test connectivity
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
quickFunc () {
echo "Starting the Quick Check Suite Tests, please wait..."
sudo ./fieldiag.sh --run_on_error --test quickcheck
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
fullFunc () {
echo "Starting the Level 1 Suite Tests, please wait..."
sudo ./fieldiag.sh --run_on_error --level1
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
fullFunc2 () {
echo "Starting the Level 2 Suite Tests, please wait..."
sudo ./fieldiag.sh --run_on_error --level2
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
thermalFunc() {
echo "Starting the Thermal Testing, please wait..."
sudo ./fieldiag.sh --run_on_error --test thermal
sudo tar -zcf /tmp/$host.$SerNum.$dt.tar.xz /var/diags/629-FLD03-2987-510/fieldiag.log /var/diags/629-FLD03-2987-510/logs/* /var/diags/629-FLD03-2987-510/dgx/logs*
chmod 777 $host.$SerNum.$dt.tar.xz;curl -T /tmp/$host.$SerNum.$dt.tar.xz ftp://$ftp_server
echo " "
echo " "
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo "| Check ftp://$ftp_server for your log files, $host.$SerNum.$dt.tar.xz."
echo "| Files cleaned up. Thanks for the fish and don't forget your towel!"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo " "
echo " "
}
echo "Checking pre-requisites, please wait..."
sleep 3
if [ -d "/var/diags/629-FLD03-2987-510/" ]; then
echo "Field Diags Already Prepped"
cd /var/diags/629-FLD03-2987-510/
echo " "
sleep 2
elif [ ! -d "/var/diags/629-FLD03-2987-510/" ]; then
echo "Prepping Field Diags for usages, please wait.."
cd /var/diags/;sudo tar xfz 629-FLD03-2987-510.tgz;cd 629-FLD03-2987-510
echo " "
sleep 2
fi
if [[ $1 == 1 ]]; then
gpumemFunc;exit
elif [[ $1 == 2 ]]; then
gpustressFunc;exit
elif [[ $1 == 3 ]]; then
nvlinkFunc;exit
elif [[ $1 == 4 ]]; then
nvswitchFunc;exit
elif [[ $1 == 5 ]]; then
cudacoresFunc;exit
elif [[ $1 == 6 ]]; then
gpuperFunc;exit
elif [[ $1 == 7 ]]; then
gpuheatFunc;exit
elif [[ $1 == 8 ]]; then
thermalFunc;exit
elif [[ $1 == 9 ]]; then
videoFunc;exit
elif [[ $1 == 10 ]]; then
powerFunc;exit
elif [[ $1 == 11 ]]; then
pcieFunc;exit
elif [[ $1 == 12 ]]; then
connFunc;exit
elif [[ $1 == 13 ]]; then
quickFunc;exit
elif [[ $1 == 14 ]]; then
fullFunc;exit
elif [[ $1 == 15 ]]; then
fullFunc2;exit
fi
echo 'What test would you like to run today?'
echo '======================================'
echo ' 1. GPU Memory Test (~8m)'
echo ' 2. GPU Stress Test (~9m)'
echo ' 3. NVLink Test (~30m)'
echo ' 4. NV Switch Test (~13m)'
echo ' 5. Cuda Core Test (~5m)'
echo ' 6. GPU Performance Switch Test (~3m)'
echo ' 7. GPU Heat Sink Test (~8m)'
echo ' 8. Thermal Test (~2h 15m)'
echo ' 9. Video Test (~3m)'
echo ' 10. Power Test (~48m)'
echo ' 11. PCIe Test (~11m)'
echo ' 12. Connectivity Test (~10m)'
echo ' 13. Quick Check Suite (~40m)'
echo ' 14. Complete Suite Lvl 1 (~2h 35m)'
echo ' 15. Complete Suite Lvl 2 (~4h 50m)'
echo ' '
echo ' Any option not listed will exit script.'
read -p '=> ' runFunc
# Anything other than a defined options will exit the script.
if [[ $runFunc == 1 ]]; then
gpumemFunc
elif [[ $runFunc == 2 ]]; then
gpustressFunc
elif [[ $runFunc == 3 ]]; then
nvlinkFunc
elif [[ $runFunc == 4 ]]; then
nvswitchFunc
elif [[ $runFunc == 5 ]]; then
cudacoresFunc
elif [[ $runFunc == 6 ]]; then
gpuperFunc
elif [[ $runFunc == 7 ]]; then
gpuheatFunc
elif [[ $runFunc == 8 ]]; then
thermalFunc
elif [[ $runFunc == 9 ]]; then
videoFunc
elif [[ $runFunc == 10 ]]; then
powerFunc
elif [[ $runFunc == 11 ]]; then
pcieFunc
elif [[ $runFunc == 12 ]]; then
connFunc
elif [[ $runFunc == 13 ]]; then
quickFunc
elif [[ $runFunc == 14 ]]; then
fullFunc
elif [[ $runFunc == 15 ]]; then
fullFunc2
else
echo -e "\e[1;31mUnsupported Answer, come back with a good answer or I will not start testing.\e[0m"
exit
fi