mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 00:10:24 +08:00
25 lines
402 B
Go
25 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/fumiama/gozel/ze"
|
|
)
|
|
|
|
func main() {
|
|
gpus, err := ze.InitGPUDrivers()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Printf("Found %d GPU driver(s)\n", len(gpus))
|
|
|
|
devs, _ := gpus[0].DeviceGet()
|
|
for _, d := range devs {
|
|
prop, _ := d.DeviceGetProperties()
|
|
fmt.Printf(" Device: %s\n", string(prop.Name[:]))
|
|
}
|
|
|
|
// Found 1 GPU driver(s)
|
|
// Device: Graphics
|
|
}
|