You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cuSOLVER potrf is not CUDA-graph capturable on CUDA.jl 6.5: no graph replay with vendor dense fronts (T34 step 6, PLAN §2.5) #174
found-by-agentOpened by an implementing agent for an out-of-scope findingperformanceSpeed or memory of the numeric and solve phases; tracked in PERFORMANCE.mdupstreamBlocked on or reported to a dependency (CUDA.jl, oneAPI.jl, oneMKL, ...)
Found while working on: the chores PR #173 (#164, bench/fact_split.jl), not a task
What: cuSOLVER potrf cannot be captured into a CUDA graph on CUDA.jl 6.5.0 (CUDA runtime 13.4, H200). SDS.vendor_potrf_info! (ext/SparseDirectSolverCUDAExt.jl, device-side info, no host read: the library's regime-C / wide-front path) raises CUSOLVER_STATUS_INTERNAL_ERROR inside CUDA.capture(); cuSOLVER.potrf! raises CaptureError: cannot copy to host memory while capturing a graph. The same calls factor correctly outside capture (info = 0, relative error 2.5e-16 on a 256×256 SPD matrix). Consequence: a refactorization that includes a vendor dense front — the stock DirectSolver regime C with impl = :vendor/:auto, and the fused Cholesky with wides = :host (the default_tuning on sm_70/80/90) — is not graph-capturable; bench/fact_split.jl's graph replay now prints graph capture failed: CUSOLVERError ... CUSOLVER_STATUS_INTERNAL_ERROR on every run (PR #107 had recorded that replay as bit-identical and timing-neutral, on CUDA.jl 5.x). LDLᵀ is unaffected since #170 factors its wide fronts in-kernel on every part.
Reproducer (one process, julia --project=bench):
using CUDA, LinearAlgebra, SparseDirectSolver; const SDS = SparseDirectSolver
n =256; A0 = (M =randn(n, n); M * M'+ n * I); A =CuArray(A0); info = CUDA.zeros(Cint, 2)
SDS.vendor_potrf_info!('L', A, info, 1); CUDA.synchronize() # finecopyto!(A, A0); g = CUDA.capture() do; SDS.vendor_potrf_info!('L', A, info, 1); end# CUSOLVER_STATUS_INTERNAL_ERROR
Why it is out of scope: a property of cuSOLVER under CUDA.jl 6.5 / CUDA 13, found through a bench script; no task owns it. It constrains T34 step 6 and PLAN §2.5 (CUDA-graph replay of refactorize + inverse for n ≲ 1e5): replay is only possible with in-kernel wide fronts (wides = :merged, or the :ka dense fallbacks of T32) or by excluding the vendor calls from the captured range. It does not block T25.
Suggested fix or plan change: before T34 step 6, test whether the cuSOLVER 64-bit API (cusolverDnXpotrf with a user workspace) is capture-safe; if not, make graph replay require in-kernel wides (and document it in bench/ARCH-TUNING.md), and note in bench/fact_split.jl that the graph column needs regime_c_rows large enough that no front takes the vendor path.
Root cause found with a CUDA.jl-only MWE (H200, CUDA.jl 6.5.0, runtime 13.4, cuSOLVER 12.3.5):
Upstream: cuSOLVER 12.3.5 (CUDA 13.4) invalidates a stream capture when cusolverDnSetStream(handle, s) is called while s is being captured: the call returns SUCCESS, cuStreamEndCapture then returns CUDA_ERROR_STREAM_CAPTURE_INVALIDATED (driver log: 900 CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED from cuStreamGetDevResource). Reproduced with raw driver + cuSOLVER calls, no CUDA.capture. cuSOLVER 12.0.4 (CUDA 13.0) and 12.2.0 (CUDA 13.2) do not invalidate; 13.3 untested. cuBLAS is unaffected.
Why CUDA.jl 6.x hits it on every cuSOLVER call: CUDA.capture() now captures on a pooled dedicated stream that becomes the task's stream; the first cuSOLVER.dense_handle() inside the capture sees the new stream and calls cusolverDnSetStream during it. CUDA.jl 5.x captured on the task's own stream (already bound), hence PR Performance prototypes: partitioned-inverse solve, split/fused factorization, ordering study (experiments 0/5/6) #107's working replay. Not with_workspace, not potrf: raw cusolverDnDpotrf with everything preallocated, cusolverDnXpotrf, and every capture mode fail alike.
Workaround that works (raw potrf, Xpotrf and the vendor_potrf_info!-style path all capture and replay with info = 0, residual ~2.5e-16):
s =CuStream(; flags = CUDA.STREAM_NON_BLOCKING)
CUDA.stream!(CUDA.CUSOLVER.dense_handle, s) # bind the task's handle before the capture
g = CUDA.capture(f; stream = s)
Pinning the runtime to 13.2 also works.
So T34 step 6 / PLAN §2.5 is not blocked by vendor fronts: the CUDA extension's graph replay must bind the cuSOLVER (and for symmetry cuBLAS) handles to the capture stream before capture, until CUDA.jl does that itself or cuSOLVER is fixed. A CUDA.jl issue with the MWE is being filed by the owner.
found-by-agentOpened by an implementing agent for an out-of-scope findingperformanceSpeed or memory of the numeric and solve phases; tracked in PERFORMANCE.mdupstreamBlocked on or reported to a dependency (CUDA.jl, oneAPI.jl, oneMKL, ...)
Activity
michel2323 commentedon Oct 30, 2026
Root cause found with a CUDA.jl-only MWE (H200, CUDA.jl 6.5.0, runtime 13.4, cuSOLVER 12.3.5):
cusolverDnSetStream(handle, s)is called whilesis being captured: the call returnsSUCCESS,cuStreamEndCapturethen returnsCUDA_ERROR_STREAM_CAPTURE_INVALIDATED(driver log:900 CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED from cuStreamGetDevResource). Reproduced with raw driver + cuSOLVER calls, noCUDA.capture. cuSOLVER 12.0.4 (CUDA 13.0) and 12.2.0 (CUDA 13.2) do not invalidate; 13.3 untested. cuBLAS is unaffected.CUDA.capture()now captures on a pooled dedicated stream that becomes the task's stream; the firstcuSOLVER.dense_handle()inside the capture sees the new stream and callscusolverDnSetStreamduring it. CUDA.jl 5.x captured on the task's own stream (already bound), hence PR Performance prototypes: partitioned-inverse solve, split/fused factorization, ordering study (experiments 0/5/6) #107's working replay. Notwith_workspace, not potrf: rawcusolverDnDpotrfwith everything preallocated,cusolverDnXpotrf, and every capture mode fail alike.Xpotrfand thevendor_potrf_info!-style path all capture and replay withinfo = 0, residual ~2.5e-16):So T34 step 6 / PLAN §2.5 is not blocked by vendor fronts: the CUDA extension's graph replay must bind the cuSOLVER (and for symmetry cuBLAS) handles to the capture stream before
capture, until CUDA.jl does that itself or cuSOLVER is fixed. A CUDA.jl issue with the MWE is being filed by the owner.bench/fact_split.jl: graph capture on a stream the vendor handles are…
T34: fused pipeline — blocked L11 inverses, gpu-scope fences, coalesc…
PLAN: T34 follow-ups (graph replay rule #174, device_fence hook, §3.4…
Review nits and PLAN housekeeping for #144, #159, #174 and the T36–T3…
Chores: fix #144, #159, #174; re-cut T24–T26 into T36–T38 (#185)
Release 0.3.0: version bump, status and installation text, "What to e…
Fused LDLᵀ: graph-replay refinement test compares the same solver (refs
Fused LDLᵀ: graph-replay refinement test compares the same solver (refs