xai-org/x-algorithm · error · ValueError
Unknown GPU architecture: {arch_str}
Error message
Unknown GPU architecture: {arch_str} What it means
string_to_gpu_arch maps a machine-type string (e.g. from MACHINE_TYPE) to a GpuArch enum by substring matching (H100, GB200, GB300, CPU, ...). Any string containing none of the known tokens raises ValueError with the offending string.
Source
Thrown at phoenix/xrex/utils/gpu.py:42
GB200 = 5
GB300 = 6
def string_to_gpu_arch(arch_str: str) -> GpuArch:
arch_str = arch_str.upper()
if "H100" in arch_str or not arch_str:
return GpuArch.H100
if "H200" in arch_str:
return GpuArch.H200
if "A100" in arch_str:
return GpuArch.A100
if "GB200" in arch_str:
return GpuArch.GB200
if "GB300" in arch_str:
return GpuArch.GB300
if "CPU" in arch_str:
return GpuArch.CPU
raise ValueError(f"Unknown GPU architecture: {arch_str}")
def _check_cuda_errors(status):
if status != 0:
raise RuntimeError(f"CUDA error: {status}")
@cache
def gpu_arch():
arch_env = os.getenv("MACHINE_TYPE", "").strip()
if arch_env:
return string_to_gpu_arch(arch_env)
try:
cuda_lib = None
legal_driver_paths = [
"/usr/lib/aarch64-linux-gnu/libcuda.so",
"/usr/lib/x86_64-linux-gnu/libcuda.so",View on GitHub (pinned to 24c60942c5)
Solutions
- Set MACHINE_TYPE to a recognized string containing a known token (A100/H100/H200/B200/GB200/GB300/CPU)
- Clear MACHINE_TYPE so detection falls through to CUDA device-name probing
- If the hardware is genuinely new, add its token to string_to_gpu_arch and GpuArch
Example fix
# before os.environ['MACHINE_TYPE'] = 'my-custom-box' # after os.environ['MACHINE_TYPE'] = '' # let CUDA probing detect H100
Defensive patterns
Strategy: validation
Validate before calling
KNOWN = ('A100','H100','H200','B200','GB200','GB300','CPU')
mt = os.getenv('MACHINE_TYPE','')
if mt and not any(k in mt for k in KNOWN):
os.environ.pop('MACHINE_TYPE') # fall back to CUDA probing Type guard
def machine_type_recognized(s: str) -> bool:
return any(k in s for k in ('A100','H100','H200','B200','GB200','GB300','CPU')) Prevention
- Set MACHINE_TYPE only to recognized values in job templates
- Validate env-driven config at startup
- Update the mapping when adopting new hardware
When it happens
Trigger: Setting MACHINE_TYPE to an unrecognized value (e.g. 'g5.xlarge' or 'tpu-v4') such that the substring checks all fail; also hit via gpu_arch() which calls this when MACHINE_TYPE is set.
Common situations: Running on newer hardware not yet in the mapping (e.g. B100); typos in MACHINE_TYPE; scheduler templates with custom machine names.
Related errors
- BDSM_CHALLENGE_SALT env var is required for challenge routin
- XAI_USER environment variable is required
- XAI_JOB_NAME environment variable is required
- XAI_CLUSTER environment variable is required
AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28).
Data as JSON: /api/errors/3e5cc434c221db9c.
Report an issue: GitHub.