Deployment and diagnostics

build_info, runtime_diagnostics, require_supported_runtime and sm_support in witwin.radar.deployment, for checking the installed CUDA library and GPU.

witwin.radar.deployment reports what native library is installed and whether this machine can run it. Use it after installing and when you file a bug report. See Backends and devices.

from witwin.radar.deployment import build_info, require_supported_runtime, runtime_diagnostics, sm_support

The three functions differ in how they fail:

FunctionLoads the libraryOn a problem
build_info()YesRaises
runtime_diagnostics()Tries toNever raises; lists problems under errors
require_supported_runtime()Tries toRaises one RuntimeError listing every problem

build_info#

build_info() -> dict[str, Any]

Load the native library and return the identity record it was validated against before loading.

Returns a dictionary with extension_path, origin, radar_abi_version and native_build. native_build holds the build identity, including torch_version, torch_target_version, cuda_version, cxx_abi, platform_tag, python_abi, cuda_architectures, compiler, cuda_compiler_version, build_type, binary_sha256, source_fingerprint, build_fingerprint, radar_git_sha, radar_git_dirty and operator_symbols.

Raises an ImportError subclass if the library is missing, and RadarExtensionABIError if the installed PyTorch, CUDA, C++ ABI or platform differs from the build identity.

info = build_info()
print(info["radar_abi_version"], info["native_build"]["torch_version"], info["native_build"]["cuda_version"])

runtime_diagnostics#

runtime_diagnostics() -> dict[str, Any]

Report the runtime without raising, whatever is broken.

Returns a dictionary with:

KeyMeaning
deployment_abi"witwin.radar.deployment.v1".
radar_abi_versionNative interface version this package expects.
package_versionInstalled witwin-radar version.
python, python_executable, platformInterpreter and OS.
torch, cuda_runtime, cuda_availablePyTorch version, its CUDA version, and whether CUDA is usable.
deviceActive GPU: name, total_memory_bytes and the sm_support fields. Present only with CUDA.
declared_sm_architectures, verified_sm_architecturesGPU architectures the release builds for, and those the test suite has run on.
sm_matrix_statusStatus of the active GPU, see sm_support.
ptx_forward_compatibility_smThe architecture whose PTX is embedded, 120.
native_buildThe build_info() record, or None if loading failed.
errorsList of problem descriptions. Empty when everything loaded.
import json
print(json.dumps(runtime_diagnostics(), indent=2, default=str))

require_supported_runtime#

require_supported_runtime() -> dict[str, Any]

Require CUDA, an active GPU whose architecture the release declares, and compiled code for that architecture in the installed library.

Returns the runtime_diagnostics() dictionary when every check passes.

Raises RuntimeError("Radar runtime requirements failed: ...") listing each failure.

sm_support#

sm_support(sm) -> dict[str, Any]

Support status of one GPU architecture.

smintrequired

Compute capability as one number, for example 120 for 12.0 or 86 for 8.6.

Returns a dictionary:

KeyMeaning
smThe architecture.
declared_supportedThe release compiles code for it.
runtime_verifiedThe test suite has run on it.
status"runtime_verified", "declared_unverified" or "not_declared".
evidenceWhere the verification comes from, for verified architectures.
mode"sass+ptx" for 120, "sass" for other declared architectures, "not_available" otherwise.

Declared architectures in 0.4.1: 70, 75, 80, 86, 87, 89, 90, 100, 101 and 120. Only 120 is runtime verified.

print(sm_support(86)["status"])   # declared_unverified