Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Stop the APU unified-memory tests inheriting the shell's GPU mask (#8662)

Daniel Han794b16e871c2
diff --git a/studio/backend/tests/test_amd_apu_unified_memory.py b/studio/backend/tests/test_amd_apu_unified_memory.py
index b1664a0d120..cade6a399ca 100644
--- a/studio/backend/tests/test_amd_apu_unified_memory.py
+++ b/studio/backend/tests/test_amd_apu_unified_memory.py
@@ -13,6 +13,19 @@ import pytest
from core.inference.llama_cpp import LlamaCppBackend
+_VISIBLE_DEVICE_MASKS = ("HIP_VISIBLE_DEVICES", "ROCR_VISIBLE_DEVICES", "CUDA_VISIBLE_DEVICES")
+
+
[email protected](autouse = True)
+def _no_inherited_gpu_mask(monkeypatch):
+ """These tests fake a torch host and then ask about GPU ordinal 0. A mask
+ inherited from the shell remaps that ordinal onto a physical id the fake
+ host does not have, so the answer flips to False and nine tests fail. CI
+ runners carry no mask, so it only ever bites locally. The tests that are
+ about a mask still set their own, after this."""
+ for _m in _VISIBLE_DEVICE_MASKS:
+ monkeypatch.delenv(_m, raising = False)
+
def _fake_torch(
hip,