mirror of
https://github.com/datarhei/core.git
synced 2025-11-02 20:24:02 +08:00
Fix GPU index numbering, promote the GPU ID
This commit is contained in:
@@ -71,6 +71,7 @@ type CPUInfo struct {
|
||||
|
||||
type GPUInfo struct {
|
||||
Index int // Index of the GPU
|
||||
ID string // Physical ID of the GPU (not populated for a specific process)
|
||||
Name string // Name of the GPU (not populated for a specific process)
|
||||
|
||||
MemoryTotal uint64 // bytes (not populated for a specific process)
|
||||
@@ -638,8 +639,10 @@ func (u *util) GPU() ([]GPUInfo, error) {
|
||||
|
||||
stats := []GPUInfo{}
|
||||
|
||||
for _, nv := range nvstats {
|
||||
for i, nv := range nvstats {
|
||||
stats = append(stats, GPUInfo{
|
||||
Index: i,
|
||||
ID: nv.ID,
|
||||
Name: nv.Name,
|
||||
MemoryTotal: nv.MemoryTotal,
|
||||
MemoryUsed: nv.MemoryUsed,
|
||||
|
||||
Reference in New Issue
Block a user