File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ The Labeller currently creates node label for the following AMD GPU properties:
2121
2222* Device ID (-device-id)
2323* Product Name (-product-name)
24+ * Driver Version (-driver-version)
25+ * Driver Source Version (-driveri-src-version)
2426* VRAM Size (-vram)
2527* Number of SIMD (-simd-count)
2628* Number of Compute Unit (-cu-count)
Original file line number Diff line number Diff line change @@ -91,6 +91,38 @@ var labelGenerators = map[string]func(map[string]map[string]int) map[string]stri
9191 }
9292 return results
9393 },
94+ "driver-version" : func (gpus map [string ]map [string ]int ) map [string ]string {
95+ version := ""
96+ for _ , v := range gpus {
97+ versionPath := fmt .Sprintf ("/sys/class/drm/card%d/device/driver/module/version" , v ["card" ])
98+ b , err := ioutil .ReadFile (versionPath )
99+ if err != nil {
100+ log .Error (err , versionPath )
101+ continue
102+ }
103+ version = strings .TrimSpace (string (b ))
104+ break
105+ }
106+
107+ pfx := createLabelPrefix ("driver-version" , true )
108+ return map [string ]string {pfx : version }
109+ },
110+ "driver-src-version" : func (gpus map [string ]map [string ]int ) map [string ]string {
111+ version := ""
112+ for _ , v := range gpus {
113+ versionPath := fmt .Sprintf ("/sys/class/drm/card%d/device/driver/module/srcversion" , v ["card" ])
114+ b , err := ioutil .ReadFile (versionPath )
115+ if err != nil {
116+ log .Error (err , versionPath )
117+ continue
118+ }
119+ version = strings .TrimSpace (string (b ))
120+ break
121+ }
122+
123+ pfx := createLabelPrefix ("driver-src-version" , true )
124+ return map [string ]string {pfx : version }
125+ },
94126 "device-id" : func (gpus map [string ]map [string ]int ) map [string ]string {
95127 counts := map [string ]int {}
96128
You can’t perform that action at this time.
0 commit comments