-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpustat.plg
140 lines (128 loc) · 3.71 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
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "gpustat">
<!ENTITY author "b3rs3rk">
<!ENTITY mod "thor2002ro">
<!ENTITY date "2024.03.28">
<!ENTITY version "&date;-x86_64-thor">
<!ENTITY launch "Settings/GPUStatSettings">
<!ENTITY gitURL "https://raw.githubusercontent.com/thor2002ro/&name;-unraid/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY pkgURL "&gitURL;/pkg">
<!ENTITY plgPATH "/boot/config/plugins/&name;">
<!ENTITY plgNAME "&name;-&version;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN
name="&name;"
author="&author;/&mod;"
version="&version;"
min="6.12.0"
support="https://forums.unraid.net/topic/89453-plugin-gpu-statistics/"
icon="icon-hardware"
launch="&launch;"
pluginURL="&pluginURL;"
>
<!-- try to install utils -->
<FILE Name="&plgPATH;/igt-gpu-tools-&version;.tgz" Min="6.10" Run="upgradepkg --install-new">
<URL>&pkgURL;/igt-gpu-tools-&version;.tgz</URL>
</FILE>
<!-- try to install utils -->
<FILE Name="&plgPATH;/radeontop-&version;.tgz" Min="6.10" Run="upgradepkg --install-new">
<URL>&pkgURL;/radeontop-&version;.tgz</URL>
</FILE>
<!-- The 'pre-install' script. -->
<FILE Run="/bin/bash">
<INLINE>
if [ "$(which nvidia-smi 2>/dev/null)" ]; then
echo "********************************************************************"
echo
echo "NVIDIA vendor utility found. Continuing install."
echo
echo "********************************************************************"
elif [ "$(which intel_gpu_top 2>/dev/null)" ]; then
echo "********************************************************************"
echo
echo "Intel vendor utility found. Continuing install."
echo
echo "********************************************************************"
elif [ "$(which radeontop 2>/dev/null)" ]; then
echo "********************************************************************"
echo
echo "AMD vendor utility found. Continuing install."
echo
echo "********************************************************************"
else
echo "********************************************************************"
echo
echo "No vendor utilities found. Plugin install terminated due to failed prerequisites."
echo
echo "********************************************************************"
rm -rf /boot/config/plugins/&name;
exit 1
fi
</INLINE>
</FILE>
<!-- The 'source' file. -->
<FILE Name="&plgPATH;/&plgNAME;.txz" Min="6.4" Run="upgradepkg --install-new">
<URL>&pkgURL;/&plgNAME;.txz</URL>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
chmod -R 777 /dev/dri
</INLINE>
</FILE>
<!-- Install default plugin cfg -->
<FILE Name="/boot/config/plugins/gpustat/gpustat.cfg">
<INLINE>
<![CDATA[
VENDOR1=""
VENDOR2=""
VENDOR3=""
GPU1=""
GPU2=""
GPU3=""
TEMPFORMAT="C"
DISPCLOCKS="1"
DISPENCDEC="1"
DISPTEMP="1"
DISPFAN="1"
DISPPCIUTIL="1"
DISPPWRDRAW="1"
DISPPWRSTATE="1"
DISPTHROTTLE="1"
DISPSESSIONS="1"
UIREFRESH="1"
UIREFRESHINT="6000"
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"
]]>
</INLINE>
</FILE>
<!-- The 'remove' script. -->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "Removing &name;..."
removepkg &plgPATH;/*.txz
removepkg &plgPATH;/*.tgz
rm -rf &plgPATH;
rm -rf &emhttp;
echo "&name; has been removed"
</INLINE>
</FILE>
</PLUGIN>