Skip to content

Commit d73deda

Browse files
Initialize gpuList array on Linux (#3536)
1 parent 6fc7ed6 commit d73deda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

data/module/gpus/gpus_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
func getGPUs() ([]types.GPU, error) {
16-
var gpuList []types.GPU
16+
gpuList := make([]types.GPU, 0)
1717

1818
// Try to get NVIDIA GPU info first
1919
cmd := exec.Command("nvidia-smi", "--query-gpu=gpu_name,memory.total,memory.used,memory.free,utilization.gpu,clocks.current.graphics,clocks.current.memory,power.draw,temperature.gpu", "--format=csv,noheader,nounits")

0 commit comments

Comments
 (0)