SPIR-V runtime library fails to build on 32-bit hosts: `unbox_int64` returns void

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

メンテナーはふだん 1 日以内に返信

@maleadt がすでに取り組んでいます。

2026年10月25日 から。

  • #1062 @maleadt による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
julia
領域
backend, compilers

調査の方向性

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

JuliaGPU/GPUCompiler.jl のほかの issue

JuliaGPU/GPUCompiler.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

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

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