Install WSL2 on Windows 11 with NVIDIA CUDA 11.8

preview_player
Показать описание
I explain how to install Ubuntu in WSL2. Afterwards I install Nvidia Cuda 11.8 and the nvidia cuda toolkit.
Then I install pip3 and pytorch. I verify the successful installation by compiling a cuda program.
I show how to fix an issue related to the accessibility of the nvidia profiler output. I have listed the exact comamnds down below the links and timestamps.
The links to the official documentation are here:
_________________________________________________________________
Timestamps:
0:00 Activate Windows Features to Install WSL2 on Windows 11/10
0:32 Setting default WSL Version to WSL2
0:44 How to Install WSL2 on Windows 11/10
1:22 basics about WSL2 commands
2:24 how to install GCC for NVIDIA CUDA
2:39 how to install NVIDIA CUDA for WSL2
4:16 how to set path variable for NVIDIA CUDA on linux
5:42 how to install nvidia cuda toolkit on linux
6:15 how to install pytorch on linux
7:45 check pytorch installation
8:15 compiling cuda program to see if cuda works
8:40 fix nvidia profiler error
9:22 how to uninstall nvidia cuda
9:57 optional: incase WSL2 does not work: install kernel update
_________________________________________________________________
Commands without comments:
cd ~
sudo apt install gcc --fix-missing
sudo apt-get updatesudo apt-get -y install cuda
_________________________________________________________________
cd ~
nano .bashrc
export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
source ~/.bashrc
echo $PATH
sudo apt install nvidia-cuda-toolkit
nvcc -V
nvidia-smi

sudo apt-get install python3-pip
python3
torch.__version__

cd ~
./test
nvprof ./test
_________________________________________________________________
#pytorch #nvidia #wsl2
_________________________________________________________________
Danke!
Рекомендации по теме
Комментарии
Автор

Ladies and gentlemen, this person right here is the textbook definition of a true Chad.

After hours and hours of following the Nvidia documentation and going through Stack Overflow, I was starting to lose hope. Once I saw your video, I was able to get everything working perfectly. Wish I had come across this sooner. Thanks for the clear and concise video!

ParatrooperK
Автор

Brother you are the hero we never deserved but always needed.

GMS-kg
Автор

THANK YOU! After thrashing through several install docs, repos and youtube videios...was about to give up... then saw your detailed step by step video that was the trick. All the other instructions never came close to succes or this detail of steps. Would never get my AI models GPU acceleration without this!!

IdPreferNot
Автор

Thank you so much!! Worked over 6hrs on searching for solution until I saw your video. That's really helpful!

carterstevenson
Автор

appreciate your time to create this!
managed to set up my dev environment for ML, thanks!

shuaishao
Автор

amazing tutorial - this still works in 2024. thank you kindly, good sir!

romayojr
Автор

After hours and hours trying, this saves my day, thanks

arthura
Автор

Thanks! It really helped a lot, I really liked the compilation example. Knowing nothing about CUDA, is nice to see how it works.

lspai
Автор

Amazing. So clear and straight forward.

JohananJoysingh
Автор

The only guide that works flawlesly. Thank you for tinkering on our behalf.

briankoech
Автор

This is an excellent tutorial. It helped me a lot. Thank you.

tjjenkin
Автор

1:05 As of 2023-08-05, after installing Ubuntu from powershell, it doesn't launch because wsl 2 "requires an update to its lethal component." You need to do a `wsl --update` after you reboot.

philwebb
Автор

I am crying been at for 2 days i'll just look up geniuses like you from now

isaiahpaul
Автор

This video is very well made, thank you!

noxden
Автор

I thank you from the bottom of my heart sir

fabibang
Автор

Great video. Would this work with a newer cuda toolkit e.g. 12.5?

CarlWells-bs
Автор

hello I have a question. this instruction doesn't explicitly install cudnn which is required by a lot deep learning packages according to their official documents. So I wonder if it's necessary to do so to prevent any potential problems

cavu
Автор

little question here: im having issues that docker on windows does not allow me to only send infos of my second gpu into the container. i wanna make sure that it just only runs at the second one.

TVPInterpolation
Автор

Hey there! First of all thanks for uploading this video.

I'd like to know if I can install the latest version of Tensorflow (instead of pytorch) using this method. I believe it is the same.
And also, once it is installed, is it available on Virtual Studio directly or do I have to do arrangements first?

Thanks in advance, regards from Argentina.

esteban.marinone
Автор

After going through nvidia documentation many times and watching and following one other video, I was about to give up. And even after seeing this video, I still found finding cuda toolkit for wsl very difficult. I was expecting to see wsl ubuntu as operating system but it showed up only after selecting linux and architecture as x86_64. @archive you could have also explained your choice of cuda version 11.8. It was only when i reached pytorch installation, i understood I should have stuck with 12.1 instead of choosing the latest 12.5. pytorch worked even with the version mismatch.

SilverCodeGuru