How to install PyTorch on WSL2 with Cuda support

Поділитися
Вставка
  • Опубліковано 8 жов 2024

КОМЕНТАРІ • 24

  • @gama3181
    @gama3181 7 місяців тому

    man .. i want to thank you so much. after a lot of tutorials and documentations , this is the first time that i can enable cuda on my WSL2. I tested it running a fastai classifier and it uses my GPU :)

  • @andreeaszocs2370
    @andreeaszocs2370 Рік тому +2

    Thank you. Thank you so much. I've been struggling with this for 2 days. All because of that mistake in the cuda installation, where you have to run step 4 again after step 5. This was my second time trying it, after failing 2 months ago. Thank you and may all the blessings you want be granted to you.

  • @JujutsuMan
    @JujutsuMan 6 місяців тому

    OMG.... you are a truly lifesaver! I was struggle in installing CUDA in VM, which is an impossible solution, then I try to look for WSL2 to install CUDA. Your video indeed help anyone want to check the script if it works in local computer before putting the scripts into DGX Platform! Many thanks again!

  • @sayokbose891
    @sayokbose891 Місяць тому

    Perfect tutorial, helped a ton!

  • @MirzokhidMukhsidov
    @MirzokhidMukhsidov 5 місяців тому +1

    I used this on CUDA 12.1 on 04.05.2024 and it worked. So if you're doubtful it's worth of a shot. Good luck.

    • @ViliamVolos
      @ViliamVolos 5 місяців тому

      hey man. Do you try to install TensorFlow after ?

  • @공자-k5m
    @공자-k5m 5 місяців тому

    You literally made my day. Thank you for your video.

  • @pulkit5435
    @pulkit5435 9 місяців тому

    Thanks for the detailed instructions. Worked for me

  • @professionalprocrastinator8103
    @professionalprocrastinator8103 9 місяців тому +1

    One needs to be extremely cautious when installing CUDA. This thing isn't forgiving. I didn't succeed straight away because before watching your video, I didn't know that I had to relaunch step #4 after launching step #5 (copying the keyring). The thing is, I tried to install another version of CUDA (12.3.0) on top of the first one (12.3.1) and the installation failed in the last step. So I had to uninstall CUDA, but I realized that the uninstallation executable was missing from /usr/local/cuda-12.3/bin/ directory, so I had to manually purge, autoremove, clean and delete any cuda package remaining on my computer, then relaunched the installation a few times from scratch, to no avail. I had to delete a few other folders manually, such as the /etc/apt/sources.list.d/cuda* ones, but it still didn't work. What finally worked for me is the deletion of all the keyrings inside the /usr/share/keyrings/ folder: the keyring from the previous installation was still inside and was preventing the apt-get install step from completing.

  • @ntinoson9275
    @ntinoson9275 7 місяців тому

    Very helpful! Does one need to also install cuDNN or it's installed automatically with Cuda??

  • @johnpi2608
    @johnpi2608 Рік тому

    I got it all working. Now onto the next part, how I do I use it in VS Code? Do you have a video for that?

  • @1010-w4d
    @1010-w4d 6 місяців тому +1

    did not work my cuda is 11.4 should i updated to 11.8 ?

  • @AntonioMac3301
    @AntonioMac3301 6 місяців тому

    i just did this in order to try and update my cuda version but when when I run nvcc --version I still get my old cuda 11.5; how do I make sure it gets updated?

  • @gama3181
    @gama3181 6 місяців тому

    Hi again! i have a question, can you help me please? We need to run all steps again each time when we create a new conda environment?
    i run this tutorial in a conda enviroment called nn and works well.
    I create other conda environment and just installed pytorch with conda. Also i cheked that nvcc is available. However when i run torch.cuda.is_available() only CPU y available.

  • @lukerabbitte2586
    @lukerabbitte2586 11 місяців тому

    Hey, great video!

  • @deborabruna3326
    @deborabruna3326 Рік тому +2

    The version of cuda that appears when I type the nvidia-smi command is 12, what should I do?

    • @DescansoAPD
      @DescansoAPD 3 місяці тому

      Hi! You must install the same version of cuda toolkit (12.0.0). But, to have everything aligned, I suggest: 1) update the Nvidia drivers on Windows, supporting at least 12.1 (above is ok, I have 12.5 with the latest driver on RTX) 2) install on WSL the corresponding cuda toolkit version (12.1.0) 3) install Pytorch cuda 12.1

  • @nisnature
    @nisnature 11 місяців тому

    Thanks for this! What can be done if the CUDA version on nvidia-smi is newer than what Pytorch supports?

  • @HirenKukadiya-v5v
    @HirenKukadiya-v5v 10 місяців тому

    how to get this screen where you write export path=...... please give some idea

    • @empyreanite2294
      @empyreanite2294 8 місяців тому

      cd to home directory, then type nano .bashrc