Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make blocking Level Zero calls GC-safe

Aperta
#698 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
hpc

Direzione di ricerca

Start by comparing the plain @ccall wrappers in lib/level-zero/libze.jl with the @gcsafe_ccall usage in lib/level-zero/synchronization.jl, then find the generator in res/wrap.jl. Check the blocking callers in lib/level-zero/module.jl, fence.jl and event.jl. Done means the blocking Level Zero calls use GC-safe ccalls, the wrappers still load, and the existing test suite passes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The generated Level Zero wrappers in lib/level-zero/libze.jl all use a plain @ccall. While such a call runs, its thread is in a GC-unsafe state, so a garbage collection requested by any other thread waits until the call returns. That only matters for calls that can block for a long time:

  • zeModuleCreate (called from ZeModule, lib/level-zero/module.jl) runs the IGC compile. On an Iris Xe with a cold NEO cache (NEO_CACHE_PERSISTENT=0) it took 19–248 ms per kernel. That is the first launch of every kernel in a session whose driver cache doesn't have it yet.
  • Base.wait(::ZeFence) and Base.wait(::ZeEvent) (lib/level-zero/fence.jl, event.jl) call zeFenceHostSynchronize/zeEventHostSynchronize with a typemax(UInt64) timeout, i.e. block for as long as the GPU work takes.

The synchronization in lib/level-zero/synchronization.jl already uses @gcsafe_ccall for the same reason, and CUDA.jl's wrapper generator emits every driver call as @gcsafe_ccall (res/wrap/wrap.jl there), e.g. cuModuleLoadData and cuLinkComplete. Either approach works here: rewrite all calls in res/wrap.jl, or only the blocking ones above. Level Zero documents these functions as thread-safe.

Lingua principale
Julia
Stelle
217
Fork
37
Merge medio
1g 7h
PR unite (30g)
38

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JuliaGPU/oneAPI.jl

Tutte le issue di JuliaGPU/oneAPI.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.