Skip to content

Commit

Permalink
move docs and tab by driver
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Sep 22, 2023
1 parent dec9f17 commit 2e6434f
Showing 1 changed file with 41 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,52 @@
---
title: "Using the Nvidia Addons"
linkTitle: "Nvidia"
title: "Using NVIDIA GPUs with minikube"
linkTitle: "Using NVIDIA GPUS with minikube"
weight: 1
date: 2018-01-02
---

## Prerequisites

- Linux
- kvm2 driver
- Latest NVIDIA GPU drivers

## Using the KVM2 driver
## Instructions per driver

When using NVIDIA GPUs with the kvm2 driver, we passthrough spare GPUs on the
{{% tabs %}}
{{% tab docker %}}

{{% /tab %}}
{{% tab none %}}
## Using the 'none' driver

NOTE: This approach used to expose GPUs here is different than the approach used
to expose GPUs with `--driver=kvm`. Please don't mix these instructions.

- Install minikube.

- Install the nvidia driver, nvidia-docker and configure docker with nvidia as
the default runtime. See instructions at
<https://github.com/NVIDIA/nvidia-docker>

- Start minikube:
```shell
minikube start --driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost
```

- Install NVIDIA's device plugin:
```shell
kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/master/nvidia-device-plugin.yml
```
{{% /tab %}}
{{% tab kvm %}}
## Using the kvm driver

When using NVIDIA GPUs with the kvm driver, we passthrough spare GPUs on the
host to the minikube VM. Doing so has a few prerequisites:

- You must install the [kvm2 driver]({{< ref "/docs/drivers/kvm2" >}}) If you already had
- You must install the [kvm driver]({{< ref "/docs/drivers/kvm2" >}}) If you already had
this installed make sure that you fetch the latest
`docker-machine-driver-kvm2` binary that has GPU support.
`docker-machine-driver-kvm` binary that has GPU support.

- Your CPU must support IOMMU. Different vendors have different names for this
technology. Intel calls it Intel VT-d. AMD calls it AMD-Vi. Your motherboard
Expand All @@ -40,9 +68,9 @@ host to the minikube VM. Doing so has a few prerequisites:
group of these GPUs.

- Once you reboot the system after doing the above, you should be ready to use
GPUs with kvm2. Run the following command to start minikube:
GPUs with kvm. Run the following command to start minikube:
```shell
minikube start --driver kvm2 --kvm-gpu
minikube start --driver kvm --kvm-gpu
```

This command will check if all the above conditions are satisfied and
Expand All @@ -68,31 +96,12 @@ host to the minikube VM. Doing so has a few prerequisites:
See the excellent documentation at
<https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF>

### Why are so many manual steps required to use GPUs with kvm2 on minikube?
### Why are so many manual steps required to use GPUs with kvm on minikube?

These steps require elevated privileges which minikube doesn't run with and they
are disruptive to the host, so we decided to not do them automatically.

## Using the 'none' driver

NOTE: This approach used to expose GPUs here is different than the approach used
to expose GPUs with `--driver=kvm2`. Please don't mix these instructions.

- Install minikube.

- Install the nvidia driver, nvidia-docker and configure docker with nvidia as
the default runtime. See instructions at
<https://github.com/NVIDIA/nvidia-docker>

- Start minikube:
```shell
minikube start --driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost
```

- Install NVIDIA's device plugin:
```shell
kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/master/nvidia-device-plugin.yml
```
{{% /tab %}}
{{% /tabs %}}

## Why does minikube not support NVIDIA GPUs on macOS?

Expand All @@ -102,7 +111,7 @@ drivers supported by minikube for macOS doesn't support GPU passthrough:
- [moby/hyperkit#159](https://github.com/moby/hyperkit/issues/159)
- [VirtualBox docs](https://www.virtualbox.org/manual/ch09.html#pcipassthrough)

Also:
Also:

- For quite a while, all Mac hardware (both laptops and desktops) have come with
Intel or AMD GPUs (and not with NVIDIA GPUs). Recently, Apple added [support
Expand Down

0 comments on commit 2e6434f

Please sign in to comment.