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_supportThe three functions differ in how they fail:
| Function | Loads the library | On a problem |
|---|---|---|
build_info() | Yes | Raises |
runtime_diagnostics() | Tries to | Never raises; lists problems under errors |
require_supported_runtime() | Tries to | Raises 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:
| Key | Meaning |
|---|---|
deployment_abi | "witwin.radar.deployment.v1". |
radar_abi_version | Native interface version this package expects. |
package_version | Installed witwin-radar version. |
python, python_executable, platform | Interpreter and OS. |
torch, cuda_runtime, cuda_available | PyTorch version, its CUDA version, and whether CUDA is usable. |
device | Active GPU: name, total_memory_bytes and the sm_support fields. Present only with CUDA. |
declared_sm_architectures, verified_sm_architectures | GPU architectures the release builds for, and those the test suite has run on. |
sm_matrix_status | Status of the active GPU, see sm_support. |
ptx_forward_compatibility_sm | The architecture whose PTX is embedded, 120. |
native_build | The build_info() record, or None if loading failed. |
errors | List 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.
Compute capability as one number, for example 120 for 12.0 or 86 for 8.6.
Returns a dictionary:
| Key | Meaning |
|---|---|
sm | The architecture. |
declared_supported | The release compiles code for it. |
runtime_verified | The test suite has run on it. |
status | "runtime_verified", "declared_unverified" or "not_declared". |
evidence | Where 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