mirror of https://gitee.com/namelin2022/ollama
Browse Source
* 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 leakbrucemacd/no-at-create
committed by
GitHub
3 changed files with 21 additions and 16 deletions
@ -0,0 +1,3 @@ |
|||
#import <Metal/Metal.h> |
|||
#include <stdint.h> |
|||
uint64_t getRecommendedMaxVRAM(); |
|||
@ -0,0 +1,11 @@ |
|||
//go:build darwin |
|||
#include "gpu_info_darwin.h" |
|||
|
|||
uint64_t getRecommendedMaxVRAM() |
|||
{ |
|||
id<MTLDevice> device = MTLCreateSystemDefaultDevice(); |
|||
uint64_t result = device.recommendedMaxWorkingSetSize; |
|||
CFRelease(device); |
|||
return result; |
|||
} |
|||
|
|||
Loading…
Reference in new issue