diff --git a/crates/cuda-driver/src/arch_ptx.rs b/crates/cuda-driver/src/arch_ptx.rs index 0293e0e6..8b75731d 100644 --- a/crates/cuda-driver/src/arch_ptx.rs +++ b/crates/cuda-driver/src/arch_ptx.rs @@ -40,7 +40,14 @@ pub(crate) fn image(ptx: &[u8]) -> &[u8] { #[cfg(feature = "sm86")] pub(crate) fn image(ptx: &[u8]) -> &[u8] { match imp::current_cc() { - Some((major, minor)) if companion_cc(major, minor) => companion_for(ptx).unwrap_or(ptx), + Some((major, minor)) if companion_cc(major, minor) => companion_for(ptx).unwrap_or_else(|| { + if std::env::var_os("LELEKA_SM86_TRACE").is_some() { + let end = ptx.iter().rposition(|&b| b != 0).map_or(0, |i| i + 1); + let d = crate::qwen_ffi::sha256(&ptx[..end]); + eprintln!("sm86: no companion for an image of {end} bytes (sha256 {:02x}{:02x}{:02x}{:02x}..); passed through", d[0], d[1], d[2], d[3]); + } + ptx + }), _ => ptx, } }