Determine max VRAM on macOS using recommendedMaxWorkingSetSize (#2354)

* read iogpu.wired_limit_mb on macOS

Fix for https://github.com/ollama/ollama/issues/1826

* improved determination of available vram on macOS

read the recommended maximal vram on macOS via Metal API

* Removed macOS-specific logging

* Remove logging from gpu_darwin.go

* release Core Foundation object

fixes a possible memory leak
This commit is contained in:
peanut256
2024-02-26 00:16:45 +01:00
committed by GitHub
parent e95b896790
commit a189810df6
3 changed files with 21 additions and 16 deletions

3
gpu/gpu_info_darwin.h Normal file
View File

@@ -0,0 +1,3 @@
#import <Metal/Metal.h>
#include <stdint.h>
uint64_t getRecommendedMaxVRAM();