[Bug] Environment check: Intel GPU detection fails — xpu-smi JSON unmarshal error (memory_physical_size_byte type mismatch)

未关闭
#14,453 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@wanghe-fit2cloud 已经在做这个了。

开始于 2026年11月16日。

评估

这个 Issue 还没有评估数据。

描述

type: optimization
Contact Information

No response

Product

1Panel

Version

v2.5.1

Problem Description

Intel GPU 环境检测失败。xpu-smi 已正确安装且 CLI 可正常输出设备信息,但 1Panel 环境检查(Environment Check)解析 xpu-smi --output json 输出时,discoveryDevice struct 中 memory_physical_size_byte 字段定义为 string 类型,而 xpu-smi 实际输出为 JSON number,导致 unmarshal 失败,检测状态显示为"检测失败"(红色)。

Steps to Reproduce
  1. 在装有 Intel iGPU(Intel Core Ultra 7 265K / Arrow Lake-S)的机器上安装 xpu-smi:

    sudo add-apt-repository ppa:kobuk-team/intel-graphics
    sudo apt install xpu-smi
    
  2. 确认 xpu-smi CLI 正常:

    $ xpu-smi
    |   0  Intel(R) Graphics    Off  | 0000:00:02.0  Off | Disabled |
    | N/A      N/A   N/A         | 26242MiB / 7797MiB | 0%  Default |
    
  3. 打开 1Panel → 环境检查 → 点击"重新检测"

  4. "Intel · 驱动与设备管理工具" 显示 检测失败(红色标记)

The expected correct result

环境检查应正确解析 xpu-smi JSON 输出,Intel GPU 显示为"正常"状态(类似 NVIDIA 的展示方式:驱动版本 + 显存信息)。

Related log output
Intel · 驱动与设备管理工具: 无法通过 xpu-smi 读取设备信息,请检查驱动状态。

xpu-smi device 0 output: json: cannot unmarshal number into Go struct field discoveryDevice.memory_physical_size_byte of type string
Additional Information
  • 1Panel 版本:v2.5.1(最新)
  • OS:Ubuntu 26.04
  • CPU:Intel Core Ultra 7 265K(Arrow Lake-S,含 Arc iGPU)
  • xpu-smi 版本:v2.3.0(Intel 官方 PPA 安装)
  • NVIDIA 部分:正常(驱动 595.99.02,RTX 5090)
  • 根因:xpu-smi JSON 输出中 memory_physical_size_byte 为整数(如 7990848512),1Panel discoveryDevice struct 定义为 string,类型不匹配
  • 修复建议:将该字段类型从 string 改为 uint64/int64,或做兼容处理(同时接受 string 和 number)
主要语言
Go
星标
37.4k
派生
3.4k
平均合并
8 小时 53 分钟
30 天内合并 PR
179

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

1Panel-dev/1Panel 的其他 Issue

查看 1Panel-dev/1Panel 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。