SPIR-V runtime library fails to build on 32-bit hosts: `unbox_int64` returns void
维护者通常 1 天内回复
评估
调研方向
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 分钟
- 30 天内合并 PR
- 40
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天 新手友好度 45/100
JuliaGPU/GPUCompiler.jl#1060 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
JuliaGPU/GPUCompiler.jl#1050 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
JuliaGPU/GPUCompiler.jl#1049 ·
维护者通常 1 天内回复
查看 JuliaGPU/GPUCompiler.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
LuxDL/DocumenterVitepress.jl#407 · 1 条评论 · 1 个 reaction ·
-
documentation priority: high
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 1/5 1 小时以内 新手友好度 90/100
epiforecasts/BVDOutbreakSize#1260 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
TuringLang/Turing.jl#2917 ·
维护者通常 1 天内回复