Skip to content

Commit c302325

Browse files
committed
GPU (macOS): use recommendedMaxWorkingSetSize as total GPU mem size
Worth noting that the value is static. It won't change even if the free global memory is smaller than the value.
1 parent 994a8b4 commit c302325

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/detection/gpu/gpu_apple.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
gpu->type = device.location == MTLDeviceLocationBuiltIn ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE;
6969
gpu->index = (uint32_t) device.locationNumber;
7070
#endif
71+
72+
if (device.hasUnifiedMemory && device.recommendedMaxWorkingSetSize > 0)
73+
gpu->shared.total = device.recommendedMaxWorkingSetSize;
7174
}
7275
return NULL;
7376
}

0 commit comments

Comments
 (0)