Pytorch not working

When I’m trying to run lesson1 in my PC, I’m getting a weird error, ie, pytorch doesn’t support this GPU anymore, I got the solution ie to use an older version of pytorch but on using older version of pytorch, torch.backends.cudnn.enabled statement gives an error that - torch.backends has no attribute cudnn

I’ve got nvidia GPU 840M

Few pointers -

  1. run import torch; torch.cuda.is_available(). I suspect it will return False
  2. run nvidia-smi on your terminal. If it says command not found, you might not have installed nvidia drivers. If it returns a table with your GPU listed then you have installed the drivers. From there you can check what version of pytorch you installed (GPU or non-GPU and what CUDA version).

So, I would suggest you do the above steps to get started. If that doesn’t help, you will need to provide more information on your setup.

  1. What OS (Windows?) - What version?
  2. What version of Python, PyTorch (you conda or pip command on how you installed pytorch)
  3. What version of cuda.
  4. print nvidia-smi command output.

I would also recommend you post in PyTorch forums ( since this looks like PyTorch install issue and not specific to Fast.AI. Hope this is useful.

1 Like

torch.cuda.is_available() - this returns True.
nvidia-smi return -

My PC config are:

  1. Ubuntu 17.10
  2. Python 3.6, pytorch 3.0
  3. cuda version 8.0

My errors are:

  1. 2.

I’m getting same error even if I run CPU only version.

You cold try Uninstalling PyTorch and Re-install PyTorch using instructions here -

Also try a toy problem with just PyTorch and see if that works. For example -

import torch
torch.FloatTensor(5, 7).cuda()

If this gives you an error, then post this to as they might have expertise to help you on PyTorch setup on your local environment.

1 Like

I have the same issue with window 10 gtx930m.

I think someone in already post a thread on PyTorch forum. The solution was build PyTorch from source and it works for me. You can go to Pytorch github page and check out how to do it.


@nok @ramesh thank You, it worked.
@nok are you facing any problem on running lesson1? My PC hangs after runnung the resnet block. I’ve nvidia gpu 840M with 2 gb graphic card and 8 gb ram

I don’t believe this GPU is supported by the latest version of pytorch, and it may be that the notebooks have been updated with code that requires the latest.

i have an XPS with a 960 card and things no longer work. I’m having to do everything in AWS for the time being.

@wgpubs use this line of code- conda install pytorch=0.1.12 cuda80 -c soumith - in the environment, it worked for me (but it is consuming too much memory so my pc is freezing)

1 Like

thanks @neil145912. i’ll give it a whirl.

were you able to run all the notebooks with it?

@wgpubs yes I’m not getting any error but since I’ve less memory, I’m facing problem somewhat like this: Get_data function running out of memory on training data in lesson 2

But I can run low end gpu programs as given in pytorch tutorial.

cool. thanks for the tip.

i got 32GB RAM and usually just run things on a smaller sample set when working on my laptop. i save the full dataset for when i push my code to AWS.

1 Like