# Add GPU

In the first step to add a GPU to a VM in the Deka GPU Portal Service you need to export the downloaded kubeconfig file via the Deka GPU Portal Service. If you haven't downloaded kubeconfig, you can press this link for further explanation. To export the kubeconfig file on the Linux operating system, you can run the following syntax.

```bash
set KUBECONFIG=C:\path\to\your\kube-config.yaml
```

Meanwhile, if you use the Windows operating system, you can run the following syntax.

```bash
export KUBECONFIG="C:/path/to/your/kube-config.yaml"
```

After exporting the KUBECONFIG Variable file, verify the connection to the Kubernetes cluster using the “cluster-info” command.

```bash
kubectl cluster-info
```

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcpKf9rVXylWl9A0ql4mPylK83epLgJFD2z_375J4rnfd2SgzLb7oijOy-HBEY43YWkzqFTpKnm1Auxn0iIv5xPRkkcHcUnFIJvHOo0c_CVzO6CU3pv_Af0635p5euDPber684IrQ?key=6sGwqPfgeqzrgLIei0ESSA" alt=""><figcaption><p>cluster-info</p></figcaption></figure>

Turn off the VM that is being configured via the Deka GPU Service Portal by click the More button and select Turn Off.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXff5eXrEFHF-J0rZvrgw4pc4j_CULe1CSV4HTzrKFt2BYn_Q3OgHWAAc8jAgeE-8JzYtAKlU9_WQxZRexrTodad4so1YXkOzD0OiDMWrD_3yNB-HqIlpdl6TRuLYNfD3OEpFbZD?key=6sGwqPfgeqzrgLIei0ESSA" alt=""><figcaption><p>Turn Off VM</p></figcaption></figure>

The "Turn Off Virtual Machine" window appears. Click the Yes button to continue turning off the VM. After successfully shutting down the VM, run the following syntax to ensure the VM has stopped running.

```bash
kubectl get vm
```

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdVFEXjI327blAnjYTK_yjOcddcLissYqL8f0_KzX7ak2Zq0RLyP3AGl-1bWErzAOQ2t8G4H8VXOvRk9wYAwjAEmsaicb8UZmMiVGmNFf66AO9n_h85Bsr4K2LlcogMFBgAo7pe?key=6sGwqPfgeqzrgLIei0ESSA" alt=""><figcaption><p>check status vm</p></figcaption></figure>

Change the manifest that the VM uses by running the following command, and add the GPU to the devices list.

```bash
kubectl edit vm vm-l40s-passthrough
```

In the specs section, above the disk, add this line.&#x20;

```yaml
gpus: 
  - deviceName: nvidia.com/AD102GL_L40S
    name: gpu1
```

So the vm-l40s-passthrough manifest looks like below.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeK5z2SQaFpW6lmS0WKSXmlIjuI30j9zcnMLJG53aeWtM4psSJ026trZg_EAA8WSqGXHkQOc2M5sIPwVPGBAnnavAb4Qteo8ofUi-XJaMyRFP_ZNeZir5FpeynI931camD07Sa6rA?key=6sGwqPfgeqzrgLIei0ESSA" alt=""><figcaption><p>add gpu</p></figcaption></figure>

Restart the VM in use via the Virtual Machine page in the Deka GPU Portal Service by pressing the More button and selecting Turn On.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe_LQUbzFsGWPUR3tAJ4VoQ2qaPc-8AuQZRPONVmPJRmg_d992t9XHwd_C7C6fJLoWqo8AzHNSF09fOwbT-qy2MQWb-yzz2b26kSaEbTzTdpDJQeGqQ6-nMOPyDg_axJ5zhDIfO?key=6sGwqPfgeqzrgLIei0ESSA" alt=""><figcaption><p>Turn On VM</p></figcaption></figure>

Run the following command to see a list of NVIDIA devices.

```bash
lspci | grep -i nvidia
```


---

# Agent Instructions: 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:

```
GET https://docs.cloudeka.ai/reference/how-to-add-gpu-in-vm/add-gpu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
