> For the complete documentation index, see [llms.txt](https://docs.ai.neevcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ai.neevcloud.com/tutorials/connect-neevcloud-gpu-to-vs-code.md).

# How to Use NeevCloud GPUs with VS Code

Connecting VS Code to a **NeevCloud GPU instance** allows you to write code on your laptop while executing it on a high-performance cloud GPU.

This setup provides a seamless experience: you use your local VS Code editor—with all your extensions, themes, and settings—while the heavy computational work is handled remotely by the GPU. You don't need to switch contexts or use a browser-based console; it feels just like coding locally.

This guide walks you through the setup and explains how to verify your code is running on the GPU.

***

## Prerequisites

Make sure you have:

* A **GPU deployed using NeevCloud GPU AI Service**
* Public IP and **SSH enabled** (default)
* Ability to SSH from terminal:

  ```bash
  ssh root@<GPU_PUBLIC_IP>
  ```
* VS Code with **Remote – SSH** extension installed

Once SSH works, VS Code can connect to the GPU.

***

## Step 1: Install Remote SSH extension in VS Code

1. Open **VS Code**
2. Go to **Extensions** (left sidebar)
3. Search for **Remote – SSH**
4. Install **Remote – SSH** by Microsoft

This extension allows VS Code to open and edit files on a remote GPU as if they were local.

***

## Step 2: Add your NeevCloud GPU as an SSH host

1. Press **Ctrl + Shift + P** (or **Cmd + Shift + P** on Mac)
2. Select **Remote-SSH: Add New SSH Host**
3. Enter your SSH command:

   ```bash
   ssh -p 2222 root@<GPU_PUBLIC_IP> -i ~/.ssh/id_ed25519
   ```
4. Save the config when prompted (default is fine)

VS Code now remembers your NeevCloud GPU as a reusable host.

***

## Step 3: Connect VS Code to the GPU instance

1. Open Command Palette again
2. Select **Remote-SSH: Connect to Host**
3. Choose your GPU host eg: `10.99.1.26`

VS Code will:

* Open a **new window**
* Install a small **VS Code Server** on the GPU

First-time setup may take up to a minute.

You are connected when:

* Bottom-left shows **SSH:**
* Any terminal you open runs on the GPU

***

## How your code uses GPU compute after connection (Important)

Once connected via Remote SSH:

**VS Code does NOT run code on your laptop anymore**

### What actually happens

* Your code files live on the **GPU instance**
* When you click **Run**, **Debug**, or open a terminal:
  * Commands execute on the **NeevCloud GPU**
  * GPU drivers, CUDA, and AI libraries are used
* Your local machine is only:
  * Displaying the editor
  * Sending keystrokes and commands

Think of it as:

> VS Code UI on your laptop + GPU compute on NeevCloud

***

## Running GPU workloads from VS Code

After SSH connection, you can run GPU workloads exactly like you would on a local machine.

### Run from Terminal

Open terminal in VS Code:

```bash
nvidia-smi
```

This confirms the GPU is available.

Run training or inference:

```bash
python train.py
python inference.py
```

These commands execute **on the NeevCloud GPU**.

***

### Run using VS Code Run / Debug

* Click **Run** on a Python file
* Or press **F5** to debug

The process:

* Starts on the GPU
* Uses CUDA, PyTorch, TensorFlow, vLLM, etc.
* Consumes GPU memory and compute

You can debug GPU-backed code just like local code.

***

## Using frameworks and libraries

NeevCloud GPU AI Service provides pre-built templates that already include:

* CUDA & NVIDIA drivers
* PyTorch / TensorFlow / vLLM (based on template)
* Python / Conda environments

As long as:

* Your code uses GPU-enabled libraries
* The environment supports CUDA

Your workloads will automatically run on GPU.

Example:

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

This will return `True` on a NeevCloud GPU instance.

***

## Why this approach is recommended on NeevCloud

Using VS Code + Remote SSH with NeevCloud GPU AI Service gives:

* Full IDE experience
* True remote GPU execution
* Faster iteration for AI/ML workflows
* Works for training, inference, and experimentation

This is the **recommended developer workflow** for NeevCloud GPU deployments.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ai.neevcloud.com/tutorials/connect-neevcloud-gpu-to-vs-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
