{
  "schema_version": "1.0",
  "id": "T-9902388ae406",
  "url": "https://gpuatlas.top/articles/T-9902388ae406/",
  "title": "llama.cpp 在混合显卡上运行，怎么分配才比较合理？",
  "summary": "llama.cpp混合显卡分配应按模式、每卡容量和速度分别调整，层数平均不等于耗时平均。",
  "language": "zh-Hans",
  "category": {
    "id": "c-09",
    "name": "框架配置与故障",
    "url": "https://gpuatlas.top/categories/c-09/"
  },
  "topics": [
    {
      "id": "framework-5c58ce0020",
      "name": "llama.cpp",
      "kind": "framework",
      "description": "用 GGUF 在本机运行模型时，GPU layers 和 CPU 卸载怎么分配？先平衡显存占用与生成速度。",
      "url": "https://gpuatlas.top/topics/framework-5c58ce0020/"
    }
  ],
  "body_text": "llama.cpp混合显卡运行，先列实际设备顺序、空闲空间与目标模型支持的拆分模式。不同卡的容量、速度和内核支持不一样，不能默认每张承担一半最合理。\n\nlayer模式可以比较分配比例，但各层的存储和计算不一定相同。tensor路径的规则、通信与支持条件不同，当前仍有实验性限制，不能把一种模式的比例或开关直接套到另一种。\n\n每张卡给缓存、缓冲和其他程序留空间，先完成最小真实请求，再增加最长日常材料。某卡先满时，另一卡剩余空间不会自动补救，应核对设备映射与实际峰值。\n\n性能方面，较慢卡可能在同步或对应阶段让其他卡等待。减少它承担的部分是否有效，需要固定输入、输出与精度对照，权重分得平均不代表耗时平均，瞬时利用率不对称也不单独证明错误。\n\n调整混合卡比例后，先观察原来最慢的阶段是否缩短，再看是否把另一张卡推到峰值边界；同时核对答案和截断。将设备顺序、模式、比例、模型与缓存对应到这次结果，再复查联合负载。合理分配是让所需任务正确且按时完成，不要求权重或利用率在两张卡上看起来一样。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "llamacpp-multigpu",
      "url": "https://raw.githubusercontent.com/ggml-org/llama.cpp/master/docs/multi-gpu.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "llamacpp-server",
      "url": "https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/README.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "nvidia-smi",
      "url": "https://docs.nvidia.com/deploy/nvidia-smi/index.html",
      "retrieved_at": "2026-11-25T10:07:29.175278+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-9902388ae406/",
    "json": "https://gpuatlas.top/data/articles/T-9902388ae406.json",
    "markdown": "https://gpuatlas.top/data/articles/T-9902388ae406.md"
  }
}
