Search code examples
pythonmachine-learningpytorchgpu

How to train PyTorch remotely on another computer?


I am going to train a Neural Net using PyTorch. I will be working from a laptop without a dedicated GPU, but I have a stationary computer with a RTX 2070 at home. Is there any way to use the computing power of my stationary computer when working from my laptop?

The only possible solution I have now is programming everything remotely with something like Moonlight Game Streaming. Would perhaps work but introduces unnecessary elements.


Solution

  • I use the home pc with laptop using SSH.

    1. You have to config your router for granting ssh port forwarding. It's pretty easy and there are many resources for this.
    2. Install SSH in stationary pc

    sudo apt-get install SSH

    1. Install ssh client on your laptop
    sudo apt-get update 
    
    sudo apt-get upgrade 
    
    sudo apt-get install openssh-client
    
    1. Then you can do "ssh userName@serverName:/path/to/folder" to login to stationary pc.

    I normally use vs code for remote development. You can use remote explorer extension(https://code.visualstudio.com/docs/remote/ssh) in vscode to edit, run and code neural nets.