核显共享显存调优:注册表大法让 26B 全量进核显

很多核显用户都会遇到同一个尴尬:模型明明 -ngl 99 全量 offload 了,却报 OutOfDeviceMemory。原因不是显卡弱,而是核显「能用多少内存」由注册表决定,默认值只有系统内存的一小部分。改一个键值,15.6GB 的 26B 就能整体进核显——这是我在 Intel Arc 140T 上实测跑通的路。

环境:Intel Arc 140T 核显 / 23.5GB 系统内存 / 驱动 32.0.101.8136(≥6974 才支持共享显存调节)。2026-09 实测。

核显显存从哪来

核显没有独立显存,用的是系统内存(共享内存 / UMA)。但驱动不会把内存全给它,而是按一个百分比划定「可用预算」,这个百分比存在注册表里:

HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager
值: SystemPartitionCommitLimitPercentage   默认 57(0x39)

改法:一条命令 + 重启

# 查看当前值
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage

# 改到 87(或 90),需管理员权限
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage -Value 87 -Type DWord

# 改完重启系统才生效

不需要 Intel Graphics Software,直接改注册表即可。驱动版本 ≥ 6974 才支持这项调节。

实际效果:预算翻倍

共享显存Vulkan 预算能跑什么
默认 57%12.67 GiB≤ 12GB 模型,26B 必 OOM
改到 87%19.73 GiB15.6GB 的 26B 全量 offload
改到 90%约 21.15 GiB余量更多(多 ~1.6GB)

关键转折:87% 生效后,supergemma4-26B(15.63GB)第一次实现 Vulkan 全量 offload,pp 243.6 t/s、tg 21.4 t/s,全面超过之前所有部分卸载方案。llama-cli 冒烟测试实时生成 ~14.3 t/s,日常可用。

原理:为什么 13.4GB 装不下 15.6GB

用 vulkaninfo 实测:device-local heap 只有 13.42 GiB,而模型是 15.63GB。模型大于堆,只能靠 host 内存溢出撑着——这正是长上下文不稳定的结构性原因(长 prefill 瞬间内存需求暴涨,驱动动态预算直接崩溃)。调大预算后,余量充足,问题自然消失。

风险与备份

  • 改完必须重启才生效
  • 系统内存余量变小:90% 预算约 21.2GB,系统剩 ~3GB,注意别同时开太多程序
  • 先备份原值,出问题一键还原
  • 不建议继续调高:模型仅剩 ~3GB 余量时继续加压没有意义,稳定性反而更差
# 备份还原命令(恢复默认 57,或你自己的原值)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage -Value 57 -Type DWord

下一步

调完显存只是第一步,长上下文还有 -ub 切块、KV 预分配、OpenVINO 官方路线这些门道,分别见20K 长上下文崩溃排查OpenVINO GenAI 官方路线

适用性提醒:本文方法针对 Intel 核显 + Windows。AMD 核显是另一套机制(UMA 帧缓冲走 BIOS),N 卡核显不存在。不同驱动版本表现有差异,改前先备份。

Every iGPU user hits the same embarrassment: -ngl 99 full offload, yet OutOfDeviceMemory. The card isn't weak — how much RAM an iGPU may borrow is set by a registry key, and the default is just a fraction of system memory. Change one value and a 15.6GB 26B fits entirely in the iGPU — I measured this on an Intel Arc 140T.

Env: Intel Arc 140T iGPU / 23.5GB system RAM / driver 32.0.101.8136 (≥6974 required for shared-memory control). Tested 2026-09.

Where an iGPU's memory comes from

An iGPU has no VRAM — it uses system RAM (shared memory / UMA). The driver doesn't hand over all of it, though; it caps a budget at some percentage, stored in the registry:

HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager
值: SystemPartitionCommitLimitPercentage   默认 57(0x39)

How to change it: one command + reboot

# 查看当前值
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage

# 改到 87(或 90),需管理员权限
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage -Value 87 -Type DWord

# 改完重启系统才生效

No need for Intel Graphics Software — the registry does it. Driver ≥6974 is required for this control.

The payoff: budget roughly doubles

Shared memoryVulkan budgetWhat fits
Default 57%12.67 GiB≤12GB models; 26B always OOMs
Raised to 87%19.73 GiB15.6GB 26B full offload
Raised to 90%~21.15 GiBmore headroom (~+1.6GB)

The turning point: at 87%, supergemma4-26B (15.63GB) achieves full Vulkan offload for the first time — pp 243.6 t/s, tg 21.4 t/s, beating every earlier partial-offload config. A llama-cli smoke test streams at ~14.3 t/s, usable daily.

Why 13.4GB can't hold 15.6GB

vulkaninfo measured a device-local heap of only 13.42 GiB against a 15.63GB model. When the model exceeds the heap, it survives on host-memory spill — which is the structural reason long contexts are unstable (a long prefill spikes memory and the driver's dynamic budget collapses). Enlarge the budget and there's headroom again.

Risks and backup

  • Reboot required for the change to apply
  • Less system RAM left: at 90% (~21.2GB budget) only ~3GB stays for the OS — don't open too much else
  • Back up the original value so you can restore in one command
  • Don't push higher: once ~3GB is left, more doesn't help and stability worsens
# 备份还原命令(恢复默认 57,或你自己的原值)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MemoryManager' -Name SystemPartitionCommitLimitPercentage -Value 57 -Type DWord

Next steps

VRAM tuning is step one; long contexts involve -ub batching, KV preallocation and the official OpenVINO route — see the 20K context debug and the OpenVINO GenAI route.

Compatibility note:This applies to Intel iGPUs on Windows. AMD uses a different mechanism (UMA frame buffer via BIOS) and NVIDIA has no iGPU. Behavior varies by driver — back up before changing.
返回文章列表