torch.cuda.is_available returns false when using ssh remote debugging

Viewed 54

when I run these code directly on colab terminal or notebook:

import torch
print(torch.cuda.is_available())

it returns True. but when I using ssh remote debugging to run this code:

sudo+ssh://root@122.27.154.150:1012/usr/bin/python3 -u /content/drive/MyDrive/python_projects/t.py

where t.py contains code:

    import torch
    print(torch.cuda.is_available())

It always return False.

I also tried to run python t.py or python2 t.py directly on colab,it always returns True.But when I switch to ssh remote running, it returns False.

What is the problem? and how to fix it ?

0 Answers
Related