From bf7edb0d5d1a52bab51d83d1558762ad9eb3dc81 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 22 May 2024 09:08:01 -0700 Subject: [PATCH] lint linux --- gpu/cuda_common.go | 1 - gpu/gpu.go | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gpu/cuda_common.go b/gpu/cuda_common.go index 03c1a25b..c90a644c 100644 --- a/gpu/cuda_common.go +++ b/gpu/cuda_common.go @@ -18,5 +18,4 @@ func cudaGetVisibleDevicesEnv(gpuInfo []GpuInfo) (string, string) { ids = append(ids, info.ID) } return "CUDA_VISIBLE_DEVICES", strings.Join(ids, ",") - } diff --git a/gpu/gpu.go b/gpu/gpu.go index 03e16702..73ef1358 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -187,7 +187,7 @@ func GetGPUInfo() GpuInfoList { resp := []GpuInfo{} // NVIDIA first - for i := 0; i < gpuHandles.deviceCount; i++ { + for i := range gpuHandles.deviceCount { // TODO once we support CPU compilation variants of GPU libraries refine this... if cpuVariant == "" && runtime.GOARCH == "amd64" { continue @@ -221,8 +221,8 @@ func GetGPUInfo() GpuInfoList { gpuInfo.MinimumMemory = cudaMinimumMemory gpuInfo.DependencyPath = depPath gpuInfo.Name = C.GoString(&memInfo.gpu_name[0]) - gpuInfo.DriverMajor = int(driverMajor) - gpuInfo.DriverMinor = int(driverMinor) + gpuInfo.DriverMajor = driverMajor + gpuInfo.DriverMinor = driverMinor // TODO potentially sort on our own algorithm instead of what the underlying GPU library does... resp = append(resp, gpuInfo)