Apple Silicon crash when Kaleido is launched with `--disable-gpu` (macOS 15.4.1, M4 Max)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
从 plotly_kaleido/src/lib.rs 中的 flag 构造开始,使用提供的 spec.json 在 macOS arm64 上复现报告的 Kaleido 0.2.1 命令。比较启用和不启用 --disable-gpu 时的渲染结果;当默认 flag 集合在 Apple Silicon 上能够成功渲染或优雅地失败时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Image generation fails on Apple Silicon when Kaleido is started with --disable-gpu (macOS 15.4.1, M4 Max)
Summary
Running the standalone Kaleido v0.2.1 binary on macOS 15.4.1 (Sequoia) with an Apple M4 Max fails to produce any image whenever the --disable-gpu flag is present (the default set that Plotly‑rs passes).
Kaleido returns error 525 ("error creating static canvas/context for image server") instead of the expected base64 payload.
Removing only that flag makes rendering work again.
Environment
| item | version / value |
|---|---|
| Kaleido binary | 0.2.1 (wheel installed via pip install kaleido) |
| macOS | 15.4.1 (23E214) |
| Chip | Apple M4 Max (arm64) |
| Python | 3.12.3 |
| Rust (for the original call) | 1.86.0 |
| Calling app | plotly‑rs 0.12 (plot.write_image) |
Reproduction steps
-
Save this Plotly spec to
spec.json:{"format":"png","width":800,"height":600,"scale":1.0,"data":{"config":{},"data":[{"name":"Surface","type":"surface","x":[1.0,2.0,3.0],"y":[4.0,5.0,6.0],"z":[[1.0,2.0,3.0],[4.0,5.0,6.0],[7.0,8.0,9.0]]}],"layout":{}}} -
Run Kaleido with the default flag set (notice
--disable-gpu):
cat spec.json | ./kaleido plotly \
--disable-gpu \
--allow-file-access-from-files \
--disable-breakpad \
--disable-dev-shm-usage \
--disable-software-rasterizer \
--single-process \
--no-sandbox \
> out.b64
Output:
[WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale en-US
{"code": 0, "message": "Success", "result": null, "version": "0.2.1"}
{"code":525,"message":"error creating static canvas/context for image server","pdfBgColor":null,"format":"png","result":null,"width":800,"height":600,"scale":1}
No image data is returned (result is null).
- Run again, this time without
--disable-gpu:
cat spec.json | ./kaleido plotly \
--allow-file-access-from-files \
--disable-breakpad \
--disable-dev-shm-usage \
--disable-software-rasterizer \
--single-process \
--no-sandbox \
> out.b64
jq -r '.result' out.b64 | base64 -d > out.png # PNG decodes correctly
Kaleido exits cleanly:
{"code": 0, "message": "Success", "result": null, "version": "0.2.1"}
Expected behaviour
Kaleido should render the plot (or at least fail gracefully) even when --disable-gpu is passed, matching behaviour on Intel Macs and Linux builds.
Actual behaviour
- With
--disable-gpu: Kaleido returns code 525 and no image. - Without
--disable-gpu: Kaleido returns the expected base64 PNG.
Notes & hypothesis
- Apple Silicon’s ANGLE‑Metal backend initialises fine; disabling the GPU appears to remove both hardware and software rasterisers, so Chrome cannot create the canvas.
- The flag combo is hard‑coded in plotly‑rs (
plotly_kaleido/src/lib.rs). Removing it there is an effective workaround. - The universal2 wheel of kaleido 1.0.0‑rc11 (Chromium 120) does not reproduce the issue, but Plotly‑rs has not migrated yet.
Workarounds
# simple wrapper to strip the flag
#!/usr/bin/env bash
exec /path/to/kaleido "${@/--disable-gpu/}"
or build/run Kaleido without passing the flag on macOS‑arm64.
Happy to provide additional logs or test patches.
— Joaquín
- 主要语言
- Python
- 星标
- 504
- 派生
- 65
- 平均合并
- 6 天 9 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/kaleido 的其他 Issue
-
Writing to an existing directory whose name has a dot fails with "Invalid format"可能已有人在做 @RaphaelFakhri 于 14 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 35/100
-
Deterministic Rendering Challenges可能重新可做 @camdecoster 于 69 天前认领,目前没有进行中的 PR。 未关闭enhancement feature P2 size: 5
-
[FEATURE]: Embed custom fonts into vector exports (no system install)可能已有人在做 @camdecoster 于 125 天前认领。 未关闭enhancement P3 size: 3
-
enhancement feature P3 size: 5
难度 5/5 一周以上 新手友好度 25/100
-
GlobalKaleidoServer is not thread-safe可能已有人在做 @talleibman 于 251 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
jejjohnson/gaussx#752 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#4270 ·
-
enhancement owner: den-haag
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ok-oldking/ok-wuthering-waves#1828 ·
维护者通常 1 天内回复
-
lesson-submission pending-review
难度 1/5 1 小时以内 新手友好度 65/100
Ikalus1988/MisakaNet#4512 ·
维护者通常 1 天内回复