*** title: Running Jupyter Notebooks description: Run JupyterLab on your NVIDIA Brev GPU instance with port forwarding. ---------------------------------------------------------------------------------- Access JupyterLab on your GPU instance with port forwarding for interactive development with GPU acceleration. ## Start JupyterLab Connect to your instance and start JupyterLab: ```bash # Connect to your instance brev shell my-instance # Start JupyterLab (no browser on remote) jupyter lab --no-browser --port=8888 ``` Copy the URL with token from the output (looks like `http://localhost:8888/lab?token=...`). ## Forward the Port In a new terminal window on your local machine: ```bash brev port-forward my-instance --port 8888:8888 ``` Now open the Jupyter URL (with token) in your local browser: `http://localhost:8888` ## Verify GPU Access In a notebook cell, verify the GPU is available: ```python import torch print(f"CUDA available: {torch.cuda.is_available()}") print(f"GPU: {torch.cuda.get_device_name(0)}") ``` ## Best Practices * Use `jupyter lab --ip 0.0.0.0` if you need to access from external hosts * Run Jupyter in a `tmux` session to keep it running after disconnecting * Forward TensorBoard on port 6006 alongside Jupyter for experiment tracking ## What's Next Run Docker workloads with GPU access. Access NVIDIA's GPU-optimized containers and models.