Has anyone successfully installed Tensorflow-GPU on WSL2 with NVIDIA GPUs? I have Ubuntu 18.04 on WSL2, but am struggling to get NVIDIA drivers installed. Any help would be appreciated as I'm lost.
So I have just got this running.
The steps you need to follow are here. To summarise them:
- sign up for windows insider program and get the development builds of windows so that you have the latest version
- Install wsl 2
- Install Ubuntu from the windows store
- Install the wsl 2 cuda driver on windows
- Install cuda toolkit
- Install cudnn (you can download the linux version from windows and then copy the file to linux)
- If you are getting memory errors like 'cannot allocate memory' then you might need to increase the amount of memory wsl can get
- Then install tensorflow-gpu
- pray it works
bugs I hit along the way:
- If when you open ubuntu for the first time you get an error you need to enable virutalisation in the bios
- If you cannot run the ./Blackscholes example in the installation instructions you might not have the right build of windows! You must have the right version
- if you are getting 'cannot allocate memory' errors when running tf you need to give wsl more ram. It only access half your ram by default
- create a .wslconfig file under your user directory in windows with the amount of memory you want. Mine looks like:
[wsl2]
memory=16GB
Edit after running some code
This is much slower then when I was running on windows directly. I went from 1 minute per epoch to 5 minutes. I'm just going to dualboot.