核显跑大模型踩坑全录:DLL 缺失到 OOM,12 个坑一次看全

核显跑大模型没有独显那么「开箱即用」,踩过的坑我都替你踩了。这份清单按时间顺序,从装环境 → 下载模型 → 选择后端 → 跑服务四个阶段整理,每个坑都给报错特征和解法。

阶段一:装环境

坑 1:0xC0000135 DLL 缺失

下载 llama.cpp 版后一运行就报 0xC0000135。原因:系统缺 vcruntime140.dll / msvcp140.dll

解法:安装微软官方 VC_redist.x64.exe 即可。
(新装机 / 精简版系统特别常见,装一次永久解决)

坑 2:版本对不上报错含义全靠猜

llama.cpp 版本推进快,b10621 时代 --dynamic-kv-cache 不存在(报 invalid argument)、默认端口未来要改 9931。参数名 / 行为以你下载的版本为准,过时教程的参数别照抄。

阶段二:下载模型

坑 3:HF 直连超时

HuggingFace 直连常超时(实测低至 60 KiB/s)。换 hf-mirror.com 镜像能到 51 MiB/s。但镜像下完要逐文件校验——见坑 4。

坑 4:下载批次静默漏文件

多线程下载大模型时,首批批次可能静默漏掉小文件(我遇到漏了 openvino_text_embeddings_model.xml),后续报错极其诡异(embedder 创建异常)。下载完逐文件核对清单,OpenVINO IR 目录共 16 个必需小文件(6×xml+bin + tokenizer/detokenizer + config/json/jinja)。

阶段三:选择后端

坑 5:Vulkan OutOfDeviceMemory(OOM)

OutOfDeviceMemory / UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY:模型超过核显可用预算。核显可用内存由注册表决定(默认 57%),SystemPartitionCommitLimitPercentage 到 87/90 并重启即可(详见核显共享显存调优)。

坑 6:OpenVINO res=-3

llama.cpp 的 OpenVINO 后端加载 26B 成功,但 prompt 解码报 res=-3。原因:gemma4 架构不在 OpenVINO 官方验证表(只覆盖 E2B/E4B/12B),且仅 stateless 模式可用。llama-bench 需加 -fa 1,长上下文崩溃(E4B pos≈1024、12B pos≈1536/2048)是已知 bug。

坑 7:OpenVINO GPU 默认走 CPU

llama.cpp 的 OpenVINO 后端默认用 CPU,要设 GGML_OPENVINO_DEVICE=GPU 才走核显。用前先确认设备识别。

坑 8:GPU 向参数在纯 CPU 上全是负优化

纯 CPU 跑时,--flash-attn、KV 量化、投机解码全都没正收益(见纯 CPU 实测)。线程数 = 物理核心数,多开只会更慢。

阶段四:跑服务

坑 9:后台进程被回收,服务无法常驻

用 schtasks / WScript / Start-Process 拉起的 llama-server 会被系统回收,无法常驻。必须在你自己的终端手动运行。Start-Process 在 PowerShell 里会随会话结束退出。

坑 10:回答为空但 token 在涨

supergemma4 等社区模型带思考块,默认 reasoning_format=deepseek,思考内容全进 reasoning_contentcontent 为空。服务端加 -rea off 即可让正文直接进 content(详见llama-server 服务化)。

坑 11:长上下文 ErrorDeviceLost

Intel 核显 Vulkan 在 20K+ 长 prefill 时 vk::Queue::submit: ErrorDeviceLost——驱动级 bug,需 -ub 128/256 切块解决(详见20K 长上下文崩溃排查)。

坑 12:多模态模型忘带 mmproj

视觉模型(Qwen3-VL 等)必须同时下 mmproj 视觉编码器文件并加 --mmproj 参数(详见VL 坐标识别实测)。

总结

  • 环境装好一次性解决:VC_redist + 版本自查,后面省一半时间
  • 下载必校验:静默漏文件最坑,逐文件核对清单
  • 报错先查后端:OOM 调注册表,res=-3 换路线,ErrorDeviceLost 上 -ub
  • 服务要常驻,自己终端跑
这些坑大多不只在核显上:DLL 缺失、下载漏文件、思考块顶空、进程被回收,独显用户也会遇到。坑单通用。

Running LLMs on an iGPU isn't as plug-and-play as on a discrete GPU — I've taken the hits so you don't have to. This checklist is ordered by phase, environment → download → backend → serving, each with its error signature and fix.

Phase 1: Environment

Pit 1: 0xC0000135 missing DLL

Running a freshly downloaded llama.cpp build fails with 0xC0000135: the system lacks vcruntime140.dll / msvcp140.dll.

解法:安装微软官方 VC_redist.x64.exe 即可。
(新装机 / 精简版系统特别常见,装一次永久解决)

Pit 2: cryptic version errors

llama.cpp moves fast: in the b10621 era --dynamic-kv-cache doesn't exist (invalid argument) and the default port will move to 9931. Trust your build's flags; don't copy stale tutorials verbatim.

Phase 2: Downloading models

Pit 3: HF timeouts

HuggingFace direct links time out (measured as low as 60 KiB/s). The hf-mirror.com mirror hit 51 MiB/s. But verify each file after the mirror — see pit 4.

Pit 4: batches silently drop files

Parallel model downloads can silently drop small files (mine dropped openvino_text_embeddings_model.xml), producing baffling downstream errors (embedder creation). Verify every file after download — an OpenVINO IR dir has 16 required small files (6× xml+bin + tokenizer/detokenizer + config/json/jinja).

Phase 3: Choosing a backend

Pit 5: Vulkan OutOfDeviceMemory

OutOfDeviceMemory / UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY: the model exceeds the iGPU's usable budget. That budget is registry-driven (57% default) — raise SystemPartitionCommitLimitPercentage to 87/90 and reboot (see iGPU VRAM tuning).

Pit 6: OpenVINO res=-3

llama.cpp's OpenVINO backend loads the 26B fine but prompt decode returns res=-3. Why: gemma4 isn't on OpenVINO's official support list (only E2B/E4B/12B) and works only in stateless mode. llama-bench needs -fa 1; long-context crashes (E4B at pos≈1024, 12B at pos≈1536/2048) are known bugs.

Pit 7: OpenVINO silently runs on CPU

llama.cpp's OpenVINO backend defaults to CPU — set GGML_OPENVINO_DEVICE=GPU to use the iGPU. Confirm device detection first.

Pit 8: GPU-oriented flags hurt pure CPU

On pure CPU, --flash-attn, KV quantization and speculative decoding give nothing (see CPU-only tests). Threads = physical cores; more is slower.

Phase 4: Serving

Pit 9: background processes get reaped

llama-server launched via schtasks / WScript / Start-Process gets reaped and never stays resident. Run it in your own terminal. Start-Process exits with the PowerShell session.

Pit 10: empty answers with tokens climbing

Community models like supergemma4 ship thinking blocks; by default reasoning_format=deepseek sends everything to reasoning_content, leaving content empty. Add -rea off on the server to push answers into content (see llama-server serving).

Pit 11: long-context ErrorDeviceLost

Intel iGPU Vulkan throws vk::Queue::submit: ErrorDeviceLost on 20K+ prefills — a driver-level bug solved by -ub 128/256 chunking (see the 20K context fix).

Pit 12: multimodal models need mmproj

Vision models (Qwen3-VL, etc.) require the mmproj vision encoder file and --mmproj flag (see VL coordinate tests).

Summary

  • Fix the environment once: VC_redist + verify your build's flags — saves half the time later
  • Always verify downloads: silently dropped files are the worst; check each file against the manifest
  • Match errors to backends: OOM → registry, res=-3 → switch route, ErrorDeviceLost → -ub
  • For a resident server, run it in your own terminal
These aren't iGPU-only:Missing DLLs, dropped downloads, empty thinking-block answers and reaped processes happen on discrete GPUs too. The list is universal.
返回文章列表