Windows 10 Installation Notes (Windows command and WSL bash)

Tensorflow 1.5 rc is now available for Windows GPU. It uses CUDA 9.0. The release version, perhaps Feb 1st, will support CUDA 9.1 (current).

Well, I didnā€™t see this thread beforeā€¦ so I wrote (kind of again) a description on how I got the library working with GPU acceleration under Windows 10: https://github.com/cklukas/fastai/blob/master/doc/windows_setup.md

I needed to adjust a little of the notebook code, e.g. when listing directories, etcā€¦ Otherwise at least the first few notebooks worked very fine in my tests.

1 Like

@klukas Very nice writeup. Iā€™ll try to find some time to merge this threadā€™s notes with your writeup.

I followed your instructions to make lesson1 work on my win10 machine(GTX1060) . But it is very slow.It takes about two hours to finish model run. It seems it uses CPU not GPU. Do I need more configuration to make it work on GPU?

Did you install the cuda and cudnn drivers from nvidia.com?

CUDA:

https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64

CUDNN:

I have CUDA 8.0 and CUDA 9.1 installed. I think I use CUDA 8 for Keras and 9.x for pytorch, but I am not 100% sureā€¦

fastai needs a prerequisites validation test suite. People could run it to verify their installation including GPU compatibility. Hereā€™s a one liner which displays GPU compatibility with Tensorflow. The output will show whether a GPU has been found or not. If your GPU isnā€™t mentioned, itā€™s not visible to Tensorflow.

python -c "import tensorflow as tf;sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))"

I did this but instead got this error:-


TypeError: eq received an invalid combination of arguments - got (torch.cuda.IntTensor), but expected one of:

  • (int value)
    didnā€™t match because some of the arguments have invalid types: (torch.cuda.IntTensor)
  • (torch.cuda.LongTensor other)
    didnā€™t match because some of the arguments have invalid types: (torch.cuda.IntTensor)

Running now I had to apply extra patch, which is:

in model.py file
res.append([f(preds.data,y) for f in metrics])
res.append([f(preds.data,y.long()) for f in metrics]) #patch

1 Like

OK fix to the LongTensor problem is now pushed. Iā€™ll work on posting an official install guide after lunch.

Iā€™ve discovered, but havenā€™t reported, that the fix to LongTensor might fix lesson1 but break lesson2. Looking at some discussions on pytorch forums, it looks like there might be some mitigations already made to pytorch but not in peterjc123ā€™s 0.3 Windows version. I havenā€™t looked into it because the official Pytorch for Windows, part of pytorch 0.4, could drop as early as this week (per peterjc123). Of course, delays are the rule. Applying the programmer tardiness rule of 2x, that would put the date at end of February. My intuition is the fix should be within pytorch and fast.aiā€™s usage is reasonable.

Wow thanks

I got the lesson4 imdb sentiment notebook to work on windows 10 with WSL on the cpu.
pytorch-cpu version 0.4.0 did not work, but 0.3.1 worked together with the latest torchvision:

conda install pytorch-cpu=0.3.1 -c soumith
pip install torchvision

Spacy wouldnā€™t install at first (without gcc) but this worked:

sudo apt-get install build-essential
pip install spacy --upgrade
python -m spacy download en

That what i ended up doing. Guess wsl can be used in cpu mode ?

I am sorry to revive this topic.
Just a quick question about WSL and GPU.
Do you have any recent update on that matter? Is it a dead end?

I am stuck to windows 10 (corporate laptop) at work. Everything is fine on windows but I have tried wsl (essentially to use +vim config from Jeremy). Everything works except when running on GPU. (Lesson 10 - 2019)

Microsoft knows native GPU support is a highly requested WSL feature. Microsoft is working towards GPU support but thereā€™s lots of plumbing required. I expect an update on their progress at the next developer conference, IIRC, April 2020. For the machine learning community, GPU support in WSL is a big deal. An alternative is to use Unraid with its GPU passthrough feature.

1 Like