diff --git a/site/content/en/docs/handbook/addons/nvidia.md b/site/content/en/docs/tutorials/nvidia.md similarity index 85% rename from site/content/en/docs/handbook/addons/nvidia.md rename to site/content/en/docs/tutorials/nvidia.md index a28f34be39b9..31e22a142d56 100644 --- a/site/content/en/docs/handbook/addons/nvidia.md +++ b/site/content/en/docs/tutorials/nvidia.md @@ -1,6 +1,6 @@ --- -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 --- @@ -8,17 +8,45 @@ 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 + + +- 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 @@ -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 @@ -68,31 +96,12 @@ host to the minikube VM. Doing so has a few prerequisites: See the excellent documentation at -### 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 - - -- 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? @@ -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