Expand description
2026-09-25: Refuse a GPU whose compute capability cannot run the kernels’
architecture, before MetraleCudaBackend::new loads any module, with an
error that names both ([metrale_core::arch::ArchMismatch]); also warn
when the device’s SM count differs from the target’s sm_count.
The rule is [metrale_core::arch::ptx_arch_runs_on_device]; the
preflight’s device queries are addressed by ordinal (cuDeviceGet), not by
the calling thread’s current context (see device_compute_capability_of).
Owner: gpu-runtime (CUDA backend). Invariants:
preflight_device_arch_withreturnsOkwithout a device query when the target records no architecture.- An SM-count mismatch or an unanswered SM-count query never fails the preflight.
Functions§
- check_
arch - 2026-09-25: The verdict, without touching a GPU:
Ok(line to log), or the [metrale_core::arch::ArchMismatch] as the error. Testable with no CUDA. - check_
sm_ count - 2026-09-25: Compare the device’s SM count with the target’s
kernels/<hw>/HARDWARE.toml[hardware] sm_count:Nonewhen they are equal, otherwise a warning naming both numbers and the file. The caller logs it and carries on (preflight_device_arch_with). - device_
compute_ capability - 2026-09-25:
(major, minor)compute capability of the device of the calling thread’s current context; fails without one.--check-kernelscalls it after the backend is built (kernel_gate.rscurrent_device_cc). The preflight usesdevice_compute_capability_ofinstead. - device_
compute_ capability_ of - 2026-09-25:
(major, minor)compute capability of GPUordinal, with no current context needed on the calling thread. - device_
sm_ count_ of - 2026-09-25: Streaming multiprocessors on GPU
ordinal, addressed by ordinal likedevice_compute_capability_of. Fails when the query fails or the count is <= 0. - preflight_
arch - 2026-09-25: The architecture string the preflight judges: the target’s
ptx_arch([hardware].archverbatim, e.g.sm_90a), nottarget.arch, which has thea/fsuffix stripped. The suffix decides which devices the PTX runs on: plainsm_90passes on CC 10.0 and 12.1,sm_90adoes not (ptx_arch_runs_on_device). - preflight_
device_ arch - 2026-09-25: Fail if kernels built for
compiled_archcannot run on GPUordinal. Call it beforeMetraleCudaBackend::new, which loads the modules (init_gpu_backenddoes, throughkernel_gate::gate_device_arch).