Accessing Remote Jupyter at USC ISI
Warning
This post is more than a year old. Information may be outdated.
This guide provides instructions for accessing a Jupyter Notebook on a remote server and configuring a GPU for machine learning tasks using TensorFlow and PyTorch.
Accessing the Remote Jupyter Notebook
Prerequisites
- VPN connection, if required.
- SSH access to the server.
- Your server username (e.g.,
scho@bdnf.isi.edu).
Steps to Access
-
Open Terminal:
- Windows: Use PowerShell or PuTTY.
- macOS/Linux: Use the Terminal app.
-
SSH Connection:
- Command:
- Replace
schowith your server username.
-
Navigate to Work Directory:
- Use
cdto go to your directory:
- Use
-
Start Jupyter Notebook:
- Run:
- Copy the provided URL.
-
Access Notebook Locally:
- Paste the URL into your local browser.
Setting Up GPU for TensorFlow
Prerequisites
- TensorFlow and other packages installed.
- Knowledge of available GPU numbers (0 to 7).
Steps for TensorFlow
-
Check GPU Availability:
- In Jupyter, run:
-
Configure GPU in Notebook:
-
After loading packages, set GPU:
-
Setting Up GPU for PyTorch
Prerequisites
- PyTorch installed.
- Knowledge of available GPU numbers.
Steps for PyTorch
-
Check GPU Availability:
- Same as for TensorFlow, use
!nvidia-smi.
- Same as for TensorFlow, use
-
Configure GPU in Notebook:
-
PyTorch automatically uses available GPUs, but you can specify one:
-
Use
deviceto move tensors or models to the selected device:
-
Notes
- For TensorFlow,
CUDA_VISIBLE_DEVICESsets the specific GPU. - For PyTorch,
torch.deviceis used to specify the GPU. - Always check GPU availability and usage before selecting one.