Commit cdc2ba2
committed
Fix GPU OOM on models larger than VRAM by reducing layer count on load failure
When a large model (e.g. Gemma 4 26B-A4B at 18 GB) fails to load because
llama.cpp tries to allocate all layers on a small GPU (3.7 GB VRAM), the
load itself throws before the probe loop can shed layers. Reduce the
layer count until the loading is succesfull.1 parent e4311c4 commit cdc2ba2
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
0 commit comments