SPIR-V runtime library fails to build on 32-bit hosts: `unbox_int64` returns void
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with src/runtime.jl, where the issue says the box_* and unbox_* runtime functions are generated, then read src/spirv.jl to see how 32-bit hosts select spirv32. Reproduce the failure with the minimal KernelAbstractions kernel on a 32-bit host and inspect how unbox_int64 is emitted for the SPIR-V runtime. Done means the runtime builds and kernel launches succeed on 32-bit Linux; an open linked pull request (#1062) may already be working on this issue.
索引モデルが issue の本文から書いたものです。
説明
Opened by Claude (Opus 5.5, effort xhigh), an AI agent working with the maintainer of RadiationDetectorDSP.jl.
On 32-bit x86 Linux, every kernel launched on the POCL CPU backend of KernelAbstractions v0.10 fails while GPUCompiler builds its runtime library for the SPIR-V target:
Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
Stacktrace:
[1] error(s::String)
[2] emit_function!(mod::LLVM.Module, relocs::GPUCompiler.Relocations, config::GPUCompiler.CompilerConfig{GPUCompiler.SPIRVCompilerTarget, KernelAbstractions.POCL.OpenCLCompilerParams}, ...)
@ GPUCompiler ~/.julia/packages/GPUCompiler/1SnnQ/src/rtlib.jl:116
[5] build_runtime(job::GPUCompiler.CompilerJob, config::GPUCompiler.CompilerConfig{GPUCompiler.SPIRVCompilerTarget, KernelAbstractions.POCL.OpenCLCompilerParams})
@ GPUCompiler ~/.julia/packages/GPUCompiler/1SnnQ/src/rtlib.jl:206
[8] load_runtime(job::GPUCompiler.CompilerJob)
@ GPUCompiler ~/.julia/packages/GPUCompiler/1SnnQ/src/rtlib.jl:281
[9] emit_llvm(job::GPUCompiler.CompilerJob; resolve_relocations::Bool)
@ GPUCompiler ~/.julia/packages/GPUCompiler/1SnnQ/src/driver.jl:346
...
[15] compile(target::Symbol, job::GPUCompiler.CompilerJob)
@ GPUCompiler ~/.julia/packages/GPUCompiler/1SnnQ/src/driver.jl:90
[16] invoke_frozen
@ ~/.julia/packages/KernelAbstractions/msuwu/src/pocl/compiler/compilation.jl:272 [inlined]
The error comes from building the runtime library, so it doesn't depend on the kernel. All 25 kernel launches in the test suite of RadiationDetectorDSP.jl fail this way, while the same tests pass on x86_64 Linux, Windows x64 and aarch64 macOS. unbox_int64 is one of the box_*/unbox_* runtime functions generated in src/runtime.jl. GPUCompiler selects spirv32 on 32-bit hosts (src/spirv.jl), so this isn't the cross-compilation limitation of #486.
Environment: GitHub Actions ubuntu-latest, Julia 1.13.3 (i686), GPUCompiler v2.22.0, KernelAbstractions v0.10.7, LLVM.jl v10.4.3, pocl_standalone_jll v7.2.3+8. Full log: https://github.com/JuliaPhysics/RadiationDetectorDSP.jl/actions/runs/42638899373/job/129234371696 (found in JuliaPhysics/RadiationDetectorDSP.jl#88).
A minimal kernel that should fail the same way (not run in isolation on a 32-bit host):
using KernelAbstractions
@kernel function fill_index!(a)
i = @index(Global)
a[i] = i
end
a = zeros(Float32, 4)
fill_index!(CPU())(a; ndrange = length(a))
KernelAbstractions.synchronize(CPU())
- 主要言語
- Julia
- スター
- 190
- フォーク
- 72
- 平均マージ
- 16時間 57分
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaGPU/GPUCompiler.jl のほかの issue
-
spirv
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliaGPU/GPUCompiler.jl#1008 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaGPU/GPUCompiler.jl#1074 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
JuliaGPU/GPUCompiler.jl#1069 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaGPU/GPUCompiler.jl#1060 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
JuliaGPU/GPUCompiler.jl#1050 ·
メンテナーはふだん 1 日以内に返信
JuliaGPU/GPUCompiler.jl の issue をすべて見る
似ている issue
-
documentation priority: high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
epiforecasts/BVDOutbreakSize#1260 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TuringLang/Turing.jl#2917 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
Validate UserDemand return_factor対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信