Apple Silicon crash when Kaleido is launched with `--disable-gpu` (macOS 15.4.1, M4 Max)

オープン
#323 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
macos, python, rust

調査の方向性

plotly_kaleido/src/lib.rs のフラグ構築から始め、提供された spec.json を使用して、報告された Kaleido 0.2.1 コマンドを macOS arm64 で再現します。--disable-gpu の有無でレンダリングを比較します。デフォルトのフラグセットで Apple Silicon 上のレンダリングが成功するか、正常に失敗すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

stale

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

  1. 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":{}}}
    
  2. 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).

  1. 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時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plotly/kaleido のほかの issue

plotly/kaleido の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。