r/bashonubuntuonwindows • u/VeterinarianTight102 • Dec 19 '20
WSL2 Tensorflow 2.2 GPU IS NOT AVAILABLE? Spoiler
I have been following this tutorial, but it still shows GPU IS NOT AVAILABLE.
I really need help. I am using Ubuntu-20.04 and latest Insiders build.
(1) Use PyTorch and TensorFlow with an NVIDIA GPU in the Windows Linux Subsystem (WSL) - YouTube
Fast Ring Build21277.rs_prerelease.2010207-1443
I have uninstalled Ubuntu twice and don't know what or how this is happening. Any help would be great.!
$ cat /proc/versionLinux version 5.4.72-microsoft-standard-WSL2
$nvidia-smi
$wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$bash Miniconda3-latest-Linux-x86_64.sh tools.yml>>>https://raw.githubusercontent.com/jeffheaton/t81_558_deep_learning/master/tools.yml
$conda install -y jupyter
$conda create --name tensorflow python=3.8
$conda activate tensorflow
$conda install nb_conda
$conda install -c anaconda tensorflow-gpu
$conda env update --file tools.yml
$python -m ipykernel install --user --name tensorflow --display-name "Python 3.7 (tensorflow)"
$jupyter notebook
3
u/glaubersp Dec 19 '20
u/VeterinarianTight102 I think you need to download the lastest NVIDIA driver with WSL support from here: https://developer.nvidia.com/cuda/wsl/download
Current file name is 465.21_gameready_win10-dch_64bit_international.exe
2
u/VeterinarianTight102 Dec 20 '20
Dude it worked thanks! now running TF 2.2 and PyTorch 1.8.7 with GPU ! (wish I could give an award) also I added my solution in the comments.
1
u/VeterinarianTight102 Dec 20 '20
Should I be updating Nvidia Geforce on Windows from now on?or keep the drivers as it is?
Also where can I keep up with the latest cuda installed drivers??
1
u/glaubersp Dec 20 '20
u/VeterinarianTight102 You're welcome =)
You'll probably have to update Windows, NVIDIA driver and TF libraries from time to time untill a stable version is released.I'd suggest to keep on eye on these pages:
https://developer.nvidia.com/cuda/wsl
https://docs.nvidia.com/cuda/wsl-user-guide/index.html
https://developer.nvidia.com/cuda/wsl/download1
u/VeterinarianTight102 Dec 21 '20
Is there anyway I can enable Nvidia CUDA/Developer updated to my e-mail?
2
Dec 19 '20
if you run nvidia-smi at the wsl command line can you see the GPU?
That's usually a good starting point for figuring out what broke where
1
1
u/VeterinarianTight102 Dec 19 '20
I posted it on the main post now!
2
Dec 20 '20
I couldn't get the Anaconda version of TF to work with the GPU.
I'd put in python 3.7
I'd put in the drive recommended below 465.21 test nvidia-smi
Install the CUDA tools yourself, version 10.1
Was that you that mentioned it was looking for a *.dll? I had to Google it and grab that from an older CUDA and install it with the 10.1 libs
Then I installed TF_gpu with pip install
It did work, then it blew up my laptop and locked me in an endless bootloop. MS replaced the laptop and now I'm using Colab. I'm tired of spending so much time fighting w/ libraries that won't play nice together.
Also, not sure if it's been fixed but under Ubuntu there was a weird hack you had to put in your code to use the gpu
------ # need for Keras to see Nvidia 20** gpu
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
if you Google it, you can dive into why and if you still need it
1
u/VeterinarianTight102 Dec 20 '20
Dude it worked thanks! now running TF 2.2 and PyTorch 1.8.7 with GPU ! (wish I could give an award)
2
0
Dec 20 '20
[deleted]
2
Dec 20 '20
I was totally against cloud based tools. Then I toasted 3 computers in a year.
I mostly use Linux which is the easiest to set up for ML and it'd still take a week of tinkering every time I bought a computer, then I'd update some thing and it all would break
It's a fragile system. Mostly people I know use AWS but Colab has a free and flat monthly $10 set up so I figured I'd try it for a while
1
u/VeterinarianTight102 Dec 20 '20
Can people in Asia use it or I just put in the US pin and use it as though I live there lol?Would be great to use collab pro tbh!
2
2
u/hayden_canonical Canonical Dec 19 '20
> it still shows GPU IS NOT AVAILABLE.
Can you please attach some logs or screenshots?
There are a couple tools that will complain a GPU is not available but will still be GPU accelerated.
> latest Insiders build
Beta or Dev channel? Which build number? You need to be on Dev channel, 20145 or higher.
> I have uninstalled Ubuntu twice
It probably doesn't have anything to do with Ubuntu itself.
Which kernel are you on?
$ cat /proc/version
1
•
u/WSL_subreddit_mod Moderator Dec 19 '20
I think I'm going to have to make a new rule. You can't just cite a YouTube video and say: "I did this, it didn't work"
Please, try and explain what you did. If you can't we can't help. And no, I'm not watching a rando make some video about the instructions from MS, or NVIDIA.
I don't mean to be harsh. I want to help, and I don't get paid for this. And I've been coding all day at another job I only sort of get paid for.