diff --git a/crates/pf-encode/src/enc/linux/cursor_blend.ptx b/crates/pf-encode/src/enc/linux/cursor_blend.ptx index 76c07c87..1c218508 100644 --- a/crates/pf-encode/src/enc/linux/cursor_blend.ptx +++ b/crates/pf-encode/src/enc/linux/cursor_blend.ptx @@ -6,7 +6,15 @@ // Based on NVVM 7.0.1 // -.version 9.3 +// .version lowered from the generating toolkit's 9.3 (CUDA 13.3) by hand: a driver refuses PTX +// whose ISA version is newer than its JIT (CUDA_ERROR_UNSUPPORTED_PTX_VERSION, 222 — driver +// 595.58 = CUDA 13.2 rejects a 9.3 stamp), while a stamp OLDER than the body's actual syntax is +// rejected as CUDA_ERROR_INVALID_PTX (218 — 8.0 was tried and failed against this body). 9.2 is +// the highest ISA a CUDA-13.2 driver JITs and the lowest this 13.3-emitted body accepts. +// TODO(portability): drivers older than the 13.2 era will refuse 9.2 too — the real fix is +// regenerating cursor_blend.cu with an older toolkit (CUDA 12.x) so the body itself is old, then +// stamping that toolkit's native version. Re-test on the oldest driver box after any regen. +.version 9.2 .target sm_75 .address_size 64 diff --git a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs index 282931a7..572c7faf 100644 --- a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs +++ b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs @@ -79,7 +79,11 @@ use nvidia_video_codec_sdk::sys::nvEncodeAPI as nv; /// Prebuilt PTX for the cursor-overlay blend kernels (cursor-as-metadata). Source is /// `cursor_blend.cu` beside this file; regenerate with /// `nvcc -ptx -arch=compute_75 cursor_blend.cu -o cursor_blend.ptx` after editing. JIT'd by the -/// driver, so it runs on any Turing-or-newer GPU. +/// driver, so it runs on any Turing-or-newer GPU. ⚠️ The `.version` stamp is load-bearing (see +/// the comment in the .ptx): a driver refuses PTX with an ISA newer than its JIT (error 222), +/// and a stamp older than the body's real syntax is INVALID_PTX (218) — so a new toolkit's +/// output silently kills cursor compositing on older-driver boxes. Prefer regenerating with the +/// OLDEST toolchain that compiles the .cu, and re-test on the oldest driver box. const CURSOR_PTX: &[u8] = include_bytes!("cursor_blend.ptx"); // ---------------------------------------------------------------------------------------------