Install WSL2 on Windows 11 with NVIDIA CUDA 11.8

Поделиться
HTML-код
  • Опубликовано: 13 янв 2025

Комментарии • 80

  • @ParatrooperK
    @ParatrooperK Год назад +67

    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!

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад +6

      Thanks a lot! Glad it helped you!

    • @pixelrogue
      @pixelrogue Год назад +5

      Man, the nvidia documentation is TRASH.

  • @philwebb59
    @philwebb59 Год назад +4

    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.

  • @IdPreferNot1
    @IdPreferNot1 Год назад +3

    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!!

  • @carterstevenson1536
    @carterstevenson1536 Год назад +5

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

  • @shuaishao6114
    @shuaishao6114 10 месяцев назад +1

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

  • @dave8518
    @dave8518 Месяц назад

    Your video made the process much easier, and I genuinely appreciate your time and expertise.

  • @romayojr
    @romayojr 6 месяцев назад +3

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

    • @playboicarti_vamp
      @playboicarti_vamp 6 месяцев назад +2

      did u install with cuda 11.8 or the newer versions?

    • @CarlWells-b4s
      @CarlWells-b4s 6 месяцев назад +1

      same question: did you use cuda toolkit 11.8 or a newer one? (e.g. 12.5)

    • @romayojr
      @romayojr 5 месяцев назад

      @@CarlWells-b4s 11.8 just like the video suggested

    • @romayojr
      @romayojr 5 месяцев назад

      @@playboicarti_vamp 11.8 just like the video suggested

  • @AkashaVaani-mx7cq
    @AkashaVaani-mx7cq 3 месяца назад

    Perfect. That worked like a charm. Thank you so much bro... Glad to watch your video. Keep going.

  • @arthura9619
    @arthura9619 Год назад +4

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

  • @AbbasKothari
    @AbbasKothari Месяц назад

    After watching a ton of videos i found the way to put my GPU on work!!🤯

  • @CapiCorbenta
    @CapiCorbenta Месяц назад

    Thank you for the video, it was super helpful!

  • @lspai8367
    @lspai8367 Год назад

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

  • @GMS-k1g
    @GMS-k1g 3 месяца назад

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

  • @JohananJoysingh
    @JohananJoysingh 6 месяцев назад

    Amazing. So clear and straight forward.

  • @tjjenkin42
    @tjjenkin42 7 месяцев назад

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

  • @isaiahpaul56
    @isaiahpaul56 11 месяцев назад

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

  • @dhruvdagwar8336
    @dhruvdagwar8336 2 месяца назад

    5:34 what if it is not showing in consistent sessions and my .bashrc file was also empty

  • @briankoech4307
    @briankoech4307 Год назад

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

  • @noxden
    @noxden Год назад +2

    This video is very well made, thank you!

  • @fabibang3941
    @fabibang3941 Год назад

    I thank you from the bottom of my heart sir

  • @TVPInterpolation
    @TVPInterpolation 6 месяцев назад

    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.

  • @CarlWells-b4s
    @CarlWells-b4s 6 месяцев назад

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

  • @ajaygunalan1995
    @ajaygunalan1995 Месяц назад

    Hi, How to resolve if it is not consistent across different sessions?

  • @cavu2555
    @cavu2555 4 месяца назад

    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

  • @ramencat1351
    @ramencat1351 Месяц назад

    A little question, this works without a nvidia gpu?. For example machines with intel core?,

  • @yuanpengli5361
    @yuanpengli5361 Год назад

    Thank you!The video is very helpful!

  • @SilverCodeGuru
    @SilverCodeGuru 7 месяцев назад

    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.

  • @pilooop667
    @pilooop667 Год назад +1

    würde mich sehr über weitere Videos zu wsl2 + AI anwendung/training freuen

  • @esteban.m1990
    @esteban.m1990 Год назад +1

    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.

  • @eriikrasniqii7068
    @eriikrasniqii7068 9 месяцев назад

    after running the "sudo apt-get -y install cuda" I get a Blue screen of death with code "page fault in nonpaged area" what could be the error?

  • @aronldmanki2035
    @aronldmanki2035 Год назад +1

    why is this happening?
    NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад +2

      Hi, this is probably because there are Nvidia Drivers installed on the ubuntu machine. This must not be the case for nvidia cuda to work properly on the wsl2 platform. WSL2 uses the Nvidia Drivers on Windows. Update your Nvidia Drivers on Windows first. Reboot your PC afterwards. Although the commands will most likely not work, you might try following commands in order:
      WSL2 Prompt:
      #sudo apt-get purge nvidia-*
      Windows CMD Prompt:
      #wsl -t Ubuntu
      wait for at least 10 seconds
      #wsl
      WSL2 Prompt:
      #sudo apt install nvidia-cuda-toolkit
      Windows CMD Prompt:
      #wsl -t Ubuntu
      wait for at least 10 seconds
      #wsl
      WSL2 Prompt:
      #nvidia-smi
      Be sure you're WSL machine is on version 2:
      C:\Users
      imda>wsl -l -v
      NAME STATE VERSION
      * Ubuntu Running 2
      If it is on version 1 use this command:
      Windows CMD Prompt
      #wsl --set-default-version 2
      I suggest you to reinstall Ubuntu WSL2 with these commands (be sure to backup your files beforehand):
      Windows CMD Prompt:
      #wsl --unregister Ubuntu
      #wsl --install --distribution Ubuntu
      The command "nvidia-smi" works on a fresh installation.

    • @aronldmanki2035
      @aronldmanki2035 Год назад +1

      ​@@Archive-pg2zn I apologize for any inconvenience caused. I found the issue preventing the update of my WSL to WSL2. By enabling the "Receive updates for other Windows products" option in the advanced settings of Windows Update and performing a quick update, I was able to reinstall Ubuntu successfully. Thank you for your understanding.

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад +2

      @@aronldmanki2035 Awesome! No worries!

  • @tuongnguyen9391
    @tuongnguyen9391 Год назад

    Say thank you from Vietnam !!!!

  • @Aisys-pk
    @Aisys-pk 10 месяцев назад

    I am getting this error when I do nvidia-smi
    Failed to initialize NVML: GPU access blocked by the operating system
    Failed to properly shut down NVML: GPU access blocked by the operating system

  • @bertbatac
    @bertbatac 7 месяцев назад

    Thank you!!! 💪💪💪

  • @mukhtarbimurat5106
    @mukhtarbimurat5106 Год назад +1

    thanks a lot, can you share cuda code you have used?

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад +1

      Thank you for watching the video! Of course, here is the CUDA code I have used:
      #include
      __global__ void hello() {
      printf("Hello, world from GPU!
      ");
      }
      int main() {
      printf("Hello, world from CPU!
      ");
      hello();
      cudaDeviceSynchronize();
      return(0);
      }
      Commands:
      nano test.cu #create file
      nvcc test.cu -o test #compile file
      ./test #run file
      nvprof ./test #profile performance

  • @GXC2356
    @GXC2356 Год назад

    Cool video, thanks ❤

  • @aghilannathan8169
    @aghilannathan8169 28 дней назад

    You are a god amount men

  • @deepakwalia9878
    @deepakwalia9878 Год назад

    great work 🙌🙌

  • @paoda2497
    @paoda2497 Год назад

    Why nvcc -V print 11.5? You should install 12.1 or something that matches your cuda?

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад

      Thank you for your comment. This question is indeed interesting and I wondered the same. To give some general context: The version that "nvidia-smi" reports (namely 12.1) refers to a different CUDA version than the 'nvcc -V' command. "nvidia-smi" reports the CUDA version that comes with the NVIDIA driver, which is installed on the Windows operating system. "nvcc -V" shows the version installed with the "sudo apt install nvidia-cuda-toolkit" command. At 5:55, you can see that it updates nothing because the CUDA version "11.5" is already installed. Here is some further reading on the topic: stackoverflow.com/questions/53422407/different-cuda-versions-shown-by-nvcc-and-nvidia-smi This is a Stack Overflow post that provides more information about the different CUDA versions shown by the commands "nvcc -V" and "nvidia-smi".
      The CUDA version 11.5 seems to be the default version that was installed. I had previously installed CUDA on this machine, and this version was probably a remnant that I didn't cleanse from the machine. Though the "CUDA version 11.8" is detected correctly by Torch, which means that the environment variable is recognized. You can see that at 8:12.

    • @paoda2497
      @paoda2497 Год назад

      @@Archive-pg2zn YEah, I also tried nvcc -V and met the same case. My WSL2 also gives me cuda version 11.5, whatever I do. And I also met another problem or probably a bug, that is, if I use num_worker>0 of dataloader in pytorch, in windows it would not report error, but it cannot load the data correctly (all elements of tensor are zero. Weird! ). On the other hand, if I use num_worker>0 in its WSL2, then it would throw me a notorious error, "CUDA UNKNOWN ERROR", which brought me to your video. I thought it could be an error caused by some incorrect operations during my installation, but acoording to your reply, it seems not so easy.

  • @lucasborges1751
    @lucasborges1751 9 месяцев назад

    THANK YOU! I LOVE U 🇧🇷🇧🇷🇧🇷🇧🇷🇧🇷

  • @Jennn
    @Jennn 9 месяцев назад

    Thank you so much!!!!

  • @unabonger777
    @unabonger777 Год назад

    does it work with CUDA kit 12.2?

    • @Archive-pg2zn
      @Archive-pg2zn  Год назад

      Yes, it works exactly the same way. You need to choose 12.2 of course and specify the path with 12.2.

  • @pilooop667
    @pilooop667 Год назад

    danke für das video, keine zeit mit nebensächlichkeiten verschwendet.
    anmerkung: wie man immer merkt das ein landsmann englisch spricht, es klingt immer so hart im gegensatz zu nativen sprechern. :D

  • @tunacevik5450
    @tunacevik5450 8 месяцев назад

    What a man

  • @jorgearagon8053
    @jorgearagon8053 Месяц назад

    In my case I needed to use Ubuntu version 22.04.5 LTS from the microsoft store, since with version 24 LTS i experienced some problems. hope this comment can help someone :)

  • @shirleyyli128
    @shirleyyli128 6 месяцев назад

    goated

  • @advait.
    @advait. Год назад

    ABSOLUTE FUCKING GIGACHAD

  • @blight9837
    @blight9837 Год назад

    *promosm*

  • @joxa6119
    @joxa6119 Год назад

    I followed your step and using Torch and its ok. But when I used Tensorflow, I got the following error
    2023-10-16 11:50:10.910187: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
    2023-10-16 11:50:10.947232: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
    2023-10-16 11:50:10.947285: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
    2023-10-16 11:50:10.947314: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
    2023-10-16 11:50:10.954375: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
    2023-10-16 11:50:10.954639: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
    To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2023-10-16 11:50:11.865881: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
    2023-10-16 11:50:13.064698: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
    Your kernel may have been built without NUMA support.
    2023-10-16 11:50:13.106098: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2211] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.

  • @АнатолийП-я2н
    @АнатолийП-я2н Год назад

    I did everything right, nvcc -V good work, but nvidia-smi:
    Command 'nvidia-smi' not found, but can be installed with:
    sudo apt install nvidia-340 # version 340.108-0ubuntu5.20.04.2, or
    sudo apt install nvidia-utils-390 # version 390.157-0ubuntu0.20.04.1
    sudo apt install nvidia-utils-450-server # version 450.248.02-0ubuntu0.20.04.1
    sudo apt install nvidia-utils-470 # version 470.199.02-0ubuntu0.20.04.1
    sudo apt install nvidia-utils-470-server # version 470.199.02-0ubuntu0.20.04.1
    sudo apt install nvidia-utils-525 # version 525.125.06-0ubuntu0.20.04.3
    sudo apt install nvidia-utils-525-server # version 525.125.06-0ubuntu0.20.04.2
    sudo apt install nvidia-utils-535 # version 535.54.03-0ubuntu0.20.04.4
    sudo apt install nvidia-utils-535-server # version 535.54.03-0ubuntu0.20.04.1
    sudo apt install nvidia-utils-435 # version 435.21-0ubuntu7
    sudo apt install nvidia-utils-440 # version 440.82+really.440.64-0ubuntu6
    sudo apt install nvidia-utils-418-server # version 418.226.00-0ubuntu0.20.04.2
    user1@k6:~$ echo $PATH
    /home/user1/.local/bin:/usr/local/cuda-11.7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/libnvvp:/mnt/c/Python311/Scripts/:/mnt/c/Python311/:/mnt/c/Python37/Scripts/:/mnt/c/Python37/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2022.2.0/:/mnt/c/Program Files/dotnet/:/mnt/c/Users/user/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/user/.dotnet/tools:/mnt/d/my_program_files/Microsoft VS Code/bin:/snap/bin
    user1@k6:~$ nvcc -V
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2022 NVIDIA Corporation
    Built on Tue_May__3_18:49:52_PDT_2022
    Cuda compilation tools, release 11.7, V11.7.64
    Build cuda_11.7.r11.7/compiler.31294372_0

  • @EyaBesbes-yd2gu
    @EyaBesbes-yd2gu 9 месяцев назад

    thank you for this tutorial. I have followed the following instructions though I don't know why I'm getting " segmentation fault ' while executing nvidia-smi:
    +-----------------------------------------------------------------------------------------+
    | NVIDIA-SMI 550.54.10 Driver Version: 551.61 CUDA Version: 12.4 |
    |-----------------------------------------+------------------------+----------------------+
    | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
    | | | MIG M. |
    |=========================================+========================+======================|
    Segmentation fault

    • @MaxZaikin
      @MaxZaikin 9 месяцев назад

      Hi Eya. I had the same issues. Downgrade your NVIDIA Host drivers, with the lower version of CUDA(12.1 in my case). It perfectly works for me, the problem has been solved and i;m able to rich my GPU from the PyTorch and tensorflow now.