ask for supported first

This commit is contained in:
Inforithmics 2025-09-25 08:47:04 +02:00
parent 05bdfedb56
commit 82f0c7e6a5
1 changed files with 7 additions and 7 deletions

View File

@ -459,13 +459,6 @@ func GetGPUInfo() GpuInfoList {
index: i,
}
C.vk_check_vram(*vHandles.vulkan, C.int(i), &memInfo)
if memInfo.err != nil {
slog.Info("error looking up vulkan GPU memory", "error", C.GoString(memInfo.err))
C.free(unsafe.Pointer(memInfo.err))
continue
}
if C.vk_device_is_supported(*vHandles.vulkan, C.int(i)) == 0 {
unsupportedGPUs = append(unsupportedGPUs,
UnsupportedGPUInfo{
@ -475,6 +468,13 @@ func GetGPUInfo() GpuInfoList {
continue
}
C.vk_check_vram(*vHandles.vulkan, C.int(i), &memInfo)
if memInfo.err != nil {
slog.Info("error looking up vulkan GPU memory", "error", C.GoString(memInfo.err))
C.free(unsafe.Pointer(memInfo.err))
continue
}
gpuInfo.TotalMemory = uint64(memInfo.total)
gpuInfo.FreeMemory = uint64(memInfo.free)
gpuInfo.ID = C.GoString(&memInfo.gpu_id[0])