This is a brief guide on how to install Archlinux as a WSL2 distribution and how to set up CUDA afterwards.
As of late, Window's WSL2 offers GPU passthrough from WSL2/Linux to Windows for NVidia graphics cards which allows to run (and develop) CUDA-based applications on the WSL2/Linux-side with almost native performance. Unfortunately, the official guides for the CUDA setup for WSL2/Linux are predominantly Ubuntu-specific. Here's to you, Arch!
- Make sure that your Windows meets the dependencies and that your WSL2 is set up. See these instructions.
Archlinux is not among the default distributions available for WSL2. We'll install it from a tarball instead, a functionality offered natively by the WSL.