A simple read-only GPU safety checker for AMD ROCm systems that detects potentially dangerous or unwanted HSA_OVERRIDE_GFX_VERSION settings before you start ComfyUI, AI workloads, or other ROCm applications.
Designed and tested around:
- CachyOS / Arch Linux
- Fish shell
- AMD Radeon RX 9070 XT
- RDNA 4
- ROCm
- Native GPU architecture:
gfx1201 - ComfyUI
- Other ROCm/PyTorch workloads
Important
This version is configured specifically for an AMD Radeon RX 9070 XT (gfx1201).
Do not assume the expected architecture is correct for another GPU.
Modern ROCm versions can detect supported AMD GPUs natively.
Older installation guides, startup scripts, AI tools, and troubleshooting instructions may still recommend setting:
HSA_OVERRIDE_GFX_VERSION=...An architecture override tells ROCm/HSA to treat the GPU as a different architecture.
For example, forcing an RX 9070 XT / gfx1201 system to use:
HSA_OVERRIDE_GFX_VERSION=11.0.0can cause serious GPU compute problems.
The goal of gpu-safety-check is simple:
Check first. Run the GPU workload second.
The checker is read-only. It reports potential problems but does not automatically change your system.
gpu-safety-check checks several places where an HSA architecture override could be introduced.
Checks whether:
HSA_OVERRIDE_GFX_VERSION
is currently active.
Checks:
- Current Fish variables
- Fish universal variables
- Persistent user configuration
This is particularly important because a command such as:
set -Ux HSA_OVERRIDE_GFX_VERSION 11.0.0creates a persistent Fish universal variable.
Checks common system locations including:
/etc/environment
/etc/environment.d
/etc/profile
/etc/profile.d
/etc/systemd/system
This can identify service-specific overrides such as those used by systemd services.
When executed from a project directory, the checker searches for executable/configuration files capable of setting HSA_OVERRIDE_GFX_VERSION.
Examples include:
*.sh
*.fish
*.bash
*.zsh
*.env
*.service
*.conf
This is useful for detecting a bundled launcher containing something like:
export HSA_OVERRIDE_GFX_VERSION="${HSA_OVERRIDE_GFX_VERSION:-11.0.0}"before you run it.
Python source files are checked for code capable of assigning the environment variable.
Code that merely reads the variable is not treated as an executable override.
README files, documentation and text files containing HSA_OVERRIDE_GFX_VERSION are reported separately as:
[INFO]
Documentation does not block the project by itself.
This distinction is important:
Documentation mentions an override → INFO
Executable file sets an override → FAIL
The checker uses:
rocminfoto verify that the expected GPU architecture is visible.
For the RX 9070 XT configuration supplied with this project, the expected architecture is:
gfx1201
Clone the repository:
git clone <YOUR-REPOSITORY-URL>
cd <YOUR-REPOSITORY>Or download the gpu-safety-check file manually.
mkdir -p ~/.local/binFrom inside the downloaded repository:
cp gpu-safety-check ~/.local/bin/gpu-safety-checkchmod +x ~/.local/bin/gpu-safety-checkBefore executing it:
fish -n ~/.local/bin/gpu-safety-checkIf the command produces no output, the Fish syntax is valid.
contains ~/.local/bin $PATH; and echo "OK: ~/.local/bin is in PATH"; or echo "WARNING: ~/.local/bin is NOT in PATH"If it is not in your PATH:
fish_add_path ~/.local/bintype -a gpu-safety-checkYou should see something similar to:
gpu-safety-check is /home/username/.local/bin/gpu-safety-check
Installation is complete.
The checker can be run from anywhere:
gpu-safety-checkHowever, the directory from which you execute it matters because the current directory is also scanned as the project.
For example, to inspect ComfyUI:
cd ~/ComfyUI
gpu-safety-checkThis checks both:
- Your current machine/environment state.
- The current ComfyUI project for files capable of introducing an HSA override.
You can do the same before using another ROCm project:
cd ~/My-AI-Project
gpu-safety-checkA healthy RX 9070 XT system should ideally show:
CURRENT MACHINE STATE
[PASS] HSA override : UNSET
[PASS] Fish persistent override : NONE
[PASS] Native ROCm GPU : gfx1201
SYSTEM / SERVICES
[PASS] Service overrides : NONE
CURRENT PROJECT
[PASS] Executable overrides : NONE
[PASS] Python assignments : NONE
CURRENT GPU STATE: SAFE
PROJECT DEVELOPMENT: SAFE
The checker can report:
CURRENT GPU STATE: SAFE
PROJECT DEVELOPMENT: BLOCKED
This distinction is intentional.
It means the GPU's current environment is safe, but the project contains executable code capable of setting HSA_OVERRIDE_GFX_VERSION.
For example:
[FAIL] Executable overrides : 3 references in 3 files
/home/user/ComfyUI/example/start_api_server_rocm.sh
/home/user/ComfyUI/example/start_gradio_ui_rocm.sh
/home/user/ComfyUI/example/start_manual_rocm.sh
Your GPU is not necessarily in danger simply because these files exist.
The warning means:
Review the affected launcher before executing it.
You may see something like:
SYSTEM / SERVICES
[WARN] Service overrides : 1 found
/etc/systemd/system/example.service.d/override.conf
A systemd service environment does not necessarily affect your current terminal.
The checker therefore reports service configuration separately from the active environment.
Do not blindly delete service configuration.
Inspect it first and understand why the service uses the setting.
The checker returns a standard exit status that can also be used by scripts.
| Exit Code | Meaning |
|---|---|
0 |
Safe |
1 |
Safe with warnings |
2 |
Active problem detected or project blocked |
After running the checker in Fish:
gpu-safety-check
echo $statusExample:
0
means the check passed without warnings.
This tool follows several deliberate rules.
gpu-safety-check does not:
- Remove environment variables
- Modify Fish configuration
- Modify systemd services
- Modify project files
- Change GPU clocks
- Change power profiles
- Write to sysfs
- Change kernel parameters
- Install or remove ROCm packages
- Modify PyTorch
- Automatically "fix" detected problems
It only inspects and reports.
For the supported RX 9070 XT configuration, the desired state is:
HSA_OVERRIDE_GFX_VERSION = UNSET
with ROCm detecting:
gfx1201
natively.
Do not replace an unwanted override with another architecture override simply to make the checker pass.
You can inspect ROCm directly with:
rocminfo | grep -E 'gfx[0-9]+'For the RX 9070 XT configuration targeted by this repository, you should see gfx1201.
The complete checker performs this verification automatically.
If PyTorch is available in the currently active Python environment, the checker displays information such as:
PyTorch : 2.x.x+rocm
ROCm/HIP : x.x
Available : True
GPU : AMD Radeon RX 9070 XT
If you see:
PyTorch : Not installed in current Python environment
this does not automatically indicate a problem.
For example, you may simply be using:
/usr/bin/python
instead of the project's virtual environment.
The checker deliberately avoids running a heavy GPU compute test as part of its normal safety scan.
Recommended environment:
-
Linux
-
CachyOS / Arch Linux
-
Fish shell
-
AMD ROCm
-
rocminfo -
Standard GNU utilities:
grepfindxargsrealpath
Optional:
- Python
- PyTorch ROCm
This version is configured for:
| Component | Configuration |
|---|---|
| GPU | AMD Radeon RX 9070 XT |
| Architecture | RDNA 4 |
| Native ROCm target | gfx1201 |
| Shell | Fish |
| Primary OS | CachyOS / Arch Linux |
| Workloads | ComfyUI, PyTorch, ROCm AI applications |
If you use another GPU, do not simply change the expected architecture without first verifying the native architecture reported by your ROCm installation.
Suggested GitHub repository topics:
amd
amd-gpu
amdgpu
rocm
rocm-linux
rdna4
rx-9070-xt
radeon
gfx1201
hsa
hsa-override
hsa-override-gfx-version
gpu-safety
gpu-diagnostics
gpu-debugging
comfyui
pytorch
pytorch-rocm
cachyos
arch-linux
fish-shell
linux
genera