Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@
#
# A separate handful drive the lowerer all the way through
# ``hipModuleLoadData``, which blocks indefinitely on a host with no ROCm
# GPU (no ``/dev/kfd``). Those are skipped when no GPU device node is
# present. The probe is deliberately torch-free (the point of this suite is
# torch-independence) and avoids issuing any HIP call that could itself hang.
# GPU (no ``/dev/kfd`` or ``/dev/dxg``). Those are skipped when no GPU device
# node is present. The probe is deliberately torch-free (the point of this
# suite is torch-independence) and avoids issuing any HIP call that could
# itself hang.

try: # torch is optional; gate torch-facing tests on its presence.
import torch as _torch # noqa: F401
Expand All @@ -98,13 +99,15 @@

import os as _os

# A ROCm GPU exposes the kernel-fusion device node at /dev/kfd. Its absence
# means launches/module loads cannot succeed and would hang; skip then.
_HAVE_GPU = _os.path.exists("/dev/kfd")
# A ROCm GPU exposes a device node the runtime can open: /dev/kfd on native
# Linux, or /dev/dxg under WSL, where ROCm reaches the GPU through the DXG
# bridge. Absence of both means launches/module loads cannot succeed and would
# hang; skip then.
Comment on lines +102 to +105

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/dev/dxg is the WSL GPU bridge, not something ROCm-specific. So the comment's framing that "a ROCm GPU exposes ... /dev/dxg under WSL" isn't quite right: its presence really signals "WSL with GPU passthrough," not that a ROCm-capable GPU is actually there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was thinking about that yesterday. This is for enabling tests for rocKE developers, so I think it's fair to assume that we're seeing an AMD GPU for testing. I'd like a more robust way to handle this, but for unblocking tests on WSL on strix halo laptops this seemed like the best way forward. Technically what I have written is correct: a ROCm GPU will show up in WSL under /dev/dgx, it's just that non-ROCm GPUs can show up there, too. I think leaving this as I have it is best right now, we can revisit if we see this choices actually causes toil or confusion.

_HAVE_GPU = _os.path.exists("/dev/kfd") or _os.path.exists("/dev/dxg")

_requires_torch = unittest.skipUnless(_HAVE_TORCH, "requires torch")
_requires_gpu = unittest.skipUnless(
_HAVE_GPU, "requires a ROCm GPU (no /dev/kfd device node present)"
_HAVE_GPU, "requires a ROCm GPU (no /dev/kfd or /dev/dxg device node present)"
)


Expand Down
Loading