forked from b3rs3rk/gpustat-unraid
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgpustat.plg
406 lines (309 loc) · 11 KB
/
gpustat.plg
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "gpustat">
<!ENTITY author "SimonFair">
<!ENTITY version "2024.12.14">
<!ENTITY launch "Settings/GPUStatSettings">
<!ENTITY gitURL "https://raw.githubusercontent.com/SimonFair/&name;-unraid/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY pkgURL "&gitURL;/pkg">
<!ENTITY plgPATH "/boot/config/plugins/&name;">
<!ENTITY plgNAME "&name;-&version;-x86_64">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN
name="&name;"
author="&author;"
version="&version;"
min="6.7.1"
support="https://forums.unraid.net/topic/89453-plugin-gpu-statistics/"
icon="icon-hardware"
launch="&launch;"
pluginURL="&pluginURL;"
>
<!--
MIT License
Copyright (c) 2020-2022 b3rs3rk
Copyright (c) 2023-2024 SimonFair
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<CHANGES>
###2024-12-14
- add QEMU app support
###2024-12-03
- re package
###2024-11-28
- plg file updates.
###2024-11-18
- fix chrome browser issue for select in settings.
###2024-11-07
- fix config path
- chg State Threshold layout for Nvidia GPUs.
###2024-10-27
- add tunarr
###2024-10-25a
- fix parent pid check so Emby is detected.
- php and max util check updates.
###2024-10-25
- add apps debug options, defaults off need to edit Intel or Nvidia lib files to make =true.
###2024-10-22a
- fix Jellyfin
###2024-10-22
- add Intel use max util from the 4 bars as title util.
###2024-10-21
- add Xorg App
- fix Emby
###2024-10-16
- add Intel timers to settings
- fix Nvidia model if not tools loaded.
###2024-10-13
- add icon to next to VM.
###2024-10-12a
- remove dependency for gpu tools.
###2024-10-12
- add Show which VM is using GPU.
###2024-09-26
- add Chia, mmx and Subspace for NV(PR from tjb-altf4 thanks)
- add revised Ollama icon(PR from nwithan8)
- add App support for Intel. Some apps may need revision to show.
###2024-08-26a
- add LocalAI app for nvidia GPU - PR from nwithan8.
- add Immich for nvidia GPU - PR from nwithan8.
###2024-08-26
- Fix timer abs values
- add Ollama app for nvidia GPU - PR from nwithan8.
###2024-06-21
- Fixes PHP errors in AMD lib.
###2024-03-16
- Change Intel processsing thanks to ich777.
- Add Compreface as an app for Nvidia thanks to Corgan.
- Set minimum refresh to 2 seconds in settings.
###2023-12-07
- Add Intel gpu top timer override value.
###2023-11-09
- Fix VFIO check function.
###2023-10-29d
- Fix passing null to checkVFIO function.
- Fix Icon issue.
###2023-10-29a
- Allow selection of NVidia GPU is driver not installed.
- Show Errors if Vendor commands missing or invalid data
- Add support for codeproject app(chillr21)
- Add support for Threadfin.
- Fix dashboard panel display if minimised.
###2023-10-06
- Show model number if GeForce card.
###2023-09-07
- Fix for new Intel_gpu_top
###2023-06-10
- Fixes for new NVidia Driver. Power draw and Throttling.
###2023-06-09
- Fix location retention issue when moving panels. Note this will reset locations and will need to be move to the required location.
###2023-05-01
- Set default for refresh to 30 seconds for new installs.
###2023-04-12a
- Fix for iGPUs call Display Controller.
###2023-03-27
- Fix apply for Multilanguage.
###2023-03-21a
- Fix GPU removal if none selected.
- Fix Show only GPU if one panel selected rather than GPU1 as title
###2022-11-30
- Fix case sensitivity in parent app detection preventing matches
- Fix parent pid command so that it correctly pulls the PPID field
- Fix string literal issue with parent command awk
###2022-11-29
- Fix issue with parent PID causing plugin to fail
###2022-11-23
- Add parent process checking for app detection
- #40 Add Frigate app detection
- #41 Add FileFlows app detection
- #42 Add ErsatzTV app detection
- #44 Attempt to fix Intel monitoring issues in 6.11
###2022-02-22
- #35 Fix jellyfin app detection looking for the wrong image path
###2022-02-20
- PR #30 Add Shinobi Pro app detection for Nvidia (thanks @corgan2222!)
- PR #30 Add nsfminer app detection for Nvidia (thanks @corgan2222!)
- #32 Reactivate Emby app detection for Nvidia with specific emby command requirement (may not work for all containers)
- #33 Add Folding@Home app detection
- Loop application image display instead of repetitive HTML
###2021-04-24
- Add DizqueTV app detection (NVIDIA) #25
- Add deepstack app detection (NVIDIA) #26
###2021-03-28
- Fix for new Intel GPU Top not outputting proper JSON (backwards compatible)
- Add Unmanic app detection
- Refines app detection to allow argument searching instead of just the base command from nvidia-smi
###2021-03-25
- [RELEASE] AMD Sensor Support
* Implement lm-sensors support
* Adds dashboard output for Temperature (APU/GPU)
* Adds dashboard output for Power Draw and Fan Utilization (GPU only)
###2021-03-19
- [RELEASE] AMD GPU Support
* AMD GPU Support via RadeonTop Plugin by @ich777
* Handbrake App Detection (NVIDIA) #21
* Tdarr App Detection (NVIDIA) #19
* GPU Long name reduction #20
###2021-02-21
- [RELEASE] Various fixes and slight improvements
* Fix for Chrome showing active application icons stretched vertically (NVIDIA) - #17
* Fix for dashboard render issues relating to cards that don't support PCI utilization metrics (NVIDIA)
* Move total sessions display to dashboard header to avoid confusion
* Add hover (alt) to application icons so that individual app processes count and memory usage will be displayed
###2021-01-21
- Fix plugin errors on boot
* Switch pre-install script from php to bash
###2021-01-20
- [RELEASE] Basic App Support
* Fix PCI Util bug with older Nvidia GPUs
* Make metric collections settings deterministic
* Refactor error methodology
* Segmentation of scripts and styles from page code
* Refactor dashboard update code (replaced setTimeout recursion)
###2021-01-17
- [RELEASE] Various fixes
* Implement PCI Utilization slider for NVIDIA
* Fix issue with plugin not installing on boot
###2021-01-15
- Fix for default settings fiasco
###2021-01-13
- [RELEASE] Implement iGPU Support
* Slight Nvidia changes to reduce plugin size with all metrics enabled
* Add PCI/IMC Bus Utilization for NVIDIA/Intel
* Make dashboard refresh interval configurable
* Thanks to @ich777 for all of his help in testing Intel
###2021-01-08
- [RELEASE] Switch to slider bars instead of raw data output
* GPUStat plugin now refreshes data on 6.9
* Thanks to @mlapaglia for the contribution
###2020-04-18
- [BETA] Allow User selectable metrics to be displayed in widget
* Go to settings and select the desired metrics after update
###2020-03-14
- [BETA] Implement Multi-GPU Selectability
* Select desired GPU for dashboard display from retrieved inventory
* Select desired temperature format (F/C)
###2020-03-10
- [BETA] Implement more NVIDIA data readings
* Clock Speeds (GPU/MEM)
* Encoder/Decoder Utilization
* Power State (P0-8)
* Throttle Check/Reason
###2020-03-08
- [BETA] Fix formatting to be more UnRAID-like
###2020-03-06
- [BETA] Implements basic NVIDIA Support for single-GPU systems
</CHANGES>
<!-- The 'pre-install' script. -->
<FILE Run="/bin/bash">
<INLINE>
if [ "$(which nvidia-smi 2>/dev/null)" ] || [ -d /boot/config/plugins/nvidia-driver ]; then
echo "********************************************************************"
echo
echo "NVIDIA vendor utility found. Continuing install."
echo
echo "********************************************************************"
elif [ "$(which intel_gpu_top 2>/dev/null)" ] || [ -d /boot/config/plugins/intel-gpu-top ]; then
echo "********************************************************************"
echo
echo "Intel vendor utility found. Continuing install."
echo
echo "********************************************************************"
elif [ "$(which radeontop 2>/dev/null)" ] || [ -d /boot/config/plugins/radeontop ]; then
echo "********************************************************************"
echo
echo "AMD vendor utility found. Continuing install."
echo
echo "********************************************************************"
else
echo "********************************************************************"
echo
echo "No vendor utilities found."
echo "Limited functions only i.e. if bound to vfio or a GPU active in a VM."
echo
echo "********************************************************************"
fi
# Check if UIREFRESHINT is at minimum 2000ms
if [ -f /boot/config/plugins/gpustat/gpustat.cfg ]; then
REFRESH_INT=$(cat /boot/config/plugins/gpustat/gpustat.cfg | grep UIREFRESHINT | cut -d '=' -f2 | sed 's/[ "]//g')
if [ "${REFRESH_INT}" -lt 2000 ]; then
sed -i '/^UIREFRESHINT/c\UIREFRESHINT = 2000' /boot/config/plugins/gpustat/gpustat.cfg
fi
fi
</INLINE>
</FILE>
<!-- The 'source' file. -->
<FILE Name="&plgPATH;/&plgNAME;.txz" Min="6.4" Run="upgradepkg --install-new">
<URL>&pkgURL;/&plgNAME;.txz</URL>
</FILE>
<!-- Install default plugin cfg -->
<FILE Name="/boot/config/plugins/gpustat/gpustat.cfg">
<INLINE>
<![CDATA[
VENDOR=""
GPUID=""
TEMPFORMAT="C"
DISPCLOCKS="1"
DISPENCDEC="1"
DISPPCIUTIL="1"
DISPTEMP="1"
DISPFAN="1"
DISPPWRDRAW="1"
DISPPWRSTATE="1"
DISPTHROTTLE="1"
DISPSESSIONS="1"
UIREFRESH="1"
UIREFRESHINT="2000"
DISPMEMUTIL="1"
DISP3DRENDER="1"
DISPBLITTER="1"
DISPVIDEO="1"
DISPVIDENH="1"
DISPINTERRUPT="1"
DISPEVENT="1"
DISPVERTEX="1"
DISPTEXTURE="1"
DISPSHADEREXP="1"
DISPSEQUENCER="1"
DISPSHADERINTER="1"
DISPSCANCON="1"
DISPPRIMASSEM="1"
DISPDEPTHBLK="1"
DISPCOLORBLK="1"
DISPGFXTRANS="1"
IGTTIMER =".7 1.3"
]]>
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
rm -f $(ls &plgPATH;/&name;*.txz 2>/dev/null|grep -v '&version;')
</INLINE>
</FILE>
<!-- The 'remove' script. -->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "Removing &name;..."
removepkg &plgPATH;/*.txz
rm -rf &plgPATH;
rm -rf &emhttp;
echo "&name; has been removed"
</INLINE>
</FILE>
</PLUGIN>