update and fix k8s gpu doc
@@ -19,7 +19,7 @@ If `alpha.kubernetes.io/nvidia-gpu` is `0` and you just created the cluster, you
When running a GPU container, you will need to specify how many GPU you want to use. If you don't specify a GPU count, kubernetes will asumme you don't require any, and will not map the device into the container.
You will also need to mount the drivers from the host (the kubernetes agent) into the container.
-On the host, the drivers are installed under `/usr/lib/nvidia-378`.
+On the host, the drivers are installed under `/usr/lib/nvidia-384`.
Here is an example template running TensorFlow:
@@ -38,15 +38,15 @@ spec:
spec:
containers:
- name: tensorflow
- image: tensorflow/tensorflow:latest-gpu
+ image: <SOME_IMAGE>
command: ["python main.py"]
imagePullPolicy: IfNotPresent
env:
- name: LD_LIBRARY_PATH
value: /usr/lib/nvidia:/usr/lib/x86_64-linux-gnu
resources:
- requests:
- alpha.kubernetes.io/nvidia-gpu: 2
+ limits:
+ alpha.kubernetes.io/nvidia-gpu: 1
volumeMounts:
- mountPath: /usr/local/nvidia/bin
name: bin
@@ -57,16 +57,16 @@ spec:
volumes:
- name: bin
hostPath:
- path: /usr/lib/nvidia-378/bin
+ path: /usr/lib/nvidia-384/bin
- name: lib
hostPath:
- path: /usr/lib/nvidia-378
+ path: /usr/lib/nvidia-384
- name: libcuda
hostPath:
path: /usr/lib/x86_64-linux-gnu/libcuda.so.1
```
-We specify `alpha.kubernetes.io/nvidia-gpu: 1` in the resources requests, and we mount the drivers from the host into the container.
+We specify `alpha.kubernetes.io/nvidia-gpu: 1` in the resources limits, and we mount the drivers from the host into the container.
Note that we also modify the `LD_LIBRARY_PATH` environment variable to let python know where to find the driver's libraries.
Some libraries, such as `libcuda.so` are installed under `/usr/lib/x86_64-linux-gnu` on the host, you might need to mount them separatly as shown above based on your needs.
