Using a Gaming PC's RTX 5070 from a separate Linux workstation
Seeking to harness a gaming PC's RTX 5070 for Linux development without compromising the gaming experience? This guide brilliantly outlines how to transform a Windows gaming machine into a headless Linux GPU server using WSL2 and SSH, providing remote access to powerful CUDA cores. It's a hacker's dream, offering a "best of both worlds" solution to a persistent developer dilemma.
The Lowdown
The author presents an elegant solution for developers who wish to leverage a high-end GPU residing in a Windows gaming PC for Linux-based workloads, all without the hassle of dual-booting or native Windows development. By turning the gaming machine into a remote Linux GPU server, the RTX 5070 becomes accessible to a separate Linux workstation.
- The setup transforms a Windows gaming PC into a headless Linux GPU server using WSL2, enabling GPU passthrough via NVIDIA's drivers.
- Key components include
sshdrunning on a custom port within WSL,netsh interface portproxyon Windows for network redirection, and a firewall rule. - An idempotent PowerShell script manages the dynamic nature of WSL's NAT IP, ensuring consistent access after reboots.
- Significant "gotchas" addressed include preventing WSL's idle shutdown (with a
wsl -- sleep infinityscheduled task), overriding Ubuntu 24.04's systemd socket activation for SSH, and avoidingnetworkingMode=mirroredif Docker/Podman is present on Windows. - Other issues covered involve ensuring
nvidia-smiis in the PATH for non-interactive SSH sessions and correctly enabling virtualization (SVM Mode on AMD) in the BIOS. - This integration allows for CUDA-accelerated tasks, like CLIP-based image searching using PyTorch
cu128, to be driven seamlessly from the Linux development machine.
Ultimately, this ingenious configuration provides a "best of both worlds" scenario: the Windows machine retains its primary function as a gaming rig, while its powerful GPU is simultaneously available for demanding Linux development tasks.