CUDA-Enabled WSL2

 

Run AI Models in CUDA-Enabled WSL2






There will be a time you need to run your models in a Linux environment. However, your most powerful GPU is running a Windows, and you don’t want to replace the whole system with Linux, and those oh, those games.

WSL2 is a good choice that balances the gap between Windows and Linux. However, when I was writing these, there are rare articles or discussions about how to enable both CUDA and PyTorch to run LLM and Stable Diffusion in WSL2. After some struggle and testing, I find out a way to run all those large AI models in WSL2 with CUDA and PyTorch enabled. and the most important part:

You must have all CUDA drivers installed in your Windows already, and smoothly running AI models with CUDA with all necessary components installed.

In the terminal, install WSL2. I found we don’t need to open Windows Store to install WSL, Install WSL from Store is kind of … I am not able to describe here, it is like rather than git pull from Github, you have to go to a Store to pay and pull a Git repository.

Post a Comment

0 Comments