Expand description
Refuse to load kernels the GPU cannot run, BEFORE the driver does it badly.
Atlas compiles one SM architecture per build, and the driver’s answer to a
mismatch is CUDA_ERROR_NO_BINARY_FOR_GPU (or
CUDA_ERROR_UNSUPPORTED_PTX_VERSION) raised inside cuModuleLoadData — an
error that names neither the arch in the binary nor the card in the box. An
operator who boots the published gb10 image on an H100 gets that, and
nothing to act on.
So this runs first: two cuDeviceGetAttribute calls, the pure rule from
atlas_core::arch, and a message that names both sides. The rule itself
lives in atlas-core because --check-kernels reports it too.
The capability query is addressed BY ORDINAL (cuDeviceGet), not by “the
calling thread’s current context” (cuCtxGetDevice). That is not a style
preference — see device_compute_capability_of. cuDeviceGetAttribute
and cuCtxGetDevice were already declared for the SM-count query;
cuDeviceGet is the one addition, alongside them.
Functions§
- check_
arch - The verdict, without touching a GPU:
Ok(line to log)or the mismatch. - check_
sm_ count - Does the running device have the SM count this build’s kernels were sized
for?
Nonewhen it agrees,Some(warning)when it does not. - device_
compute_ capability (major, minor)compute capability of the calling context’s device.- device_
compute_ capability_ of (major, minor)compute capability of GPUordinal, with NO current context required on the calling thread.- device_
sm_ count_ of - Streaming multiprocessors on GPU
ordinal, with NO current context required — addressed the same way, and for the same reason, asdevice_compute_capability_of. - preflight_
arch - Which architecture string a resolved target’s preflight must judge.
- preflight_
device_ arch - Fail fast if this binary’s kernels cannot run on GPU
ordinal.