So I need the version >= 4.19.121 to be able to use CUDA in WSL2, I’m trying to update the kernel but I have no luck. When I do wsl --status on PowerShell I get this
but when I do uname -r in a WSL window I get this:
The output for uname -r should be 5.10.43.3-microsoft-standard-WSL2
If you don’t see that try rebooting Windows and if still doesn’t work you will need to uninstall the WSL2 update in Add/Remove apps and call wsl.exe --update again.
I had to recompile the kernel. In case anyone got into the same problem
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
code .config
paste in https://raw.githubusercontent.com/microsoft/WSL2-Linux-Kernel/master/Microsoft/config-wsl
add: CONFIG_IO_URING=y
make olddefconfig
make -j $(nproc)
cp arch/x86_64/boot/bzImage /mnt/c/Users/myuser/kernel5
in windows edited
code /Users/jimh/.wslconfig
[wsl2]
kernel=c:\\Users\\myuser\\kernel5
wsl --shutdown Ubuntu-20.04
Well, of course, if you were using a custom kernel then no matter how many times you call wsl.exe --update you will always have same custom kernel version.