Created
March 23, 2018 11:59
-
-
Save alejandroandreu/5697e4193481fc617c72cbbfd486f41b to your computer and use it in GitHub Desktop.
Example of how to enable GPU computing on Kubernetes deployments (arm64v8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 [1/1901] | |
kind: Pod | |
metadata: | |
name: tensorflow-prepare | |
labels: | |
app: tensorflow-prepare | |
spec: | |
containers: | |
- name: tensorflow-prepare | |
securityContext: | |
privileged: true | |
image: alejandroandreu/tensorflow-inception-example:v0.1 | |
ports: | |
- containerPort: 8888 | |
command: ["bazel-bin/inception/download_and_preprocess_imagenet"] | |
args: ["/image-data"] | |
env: | |
- name: LD_LIBRARY_PATH | |
value: "/usr/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu/tegra:/usr/local/cuda/lib64" | |
volumeMounts: | |
# nvidia devices mapping | |
- name: nvhost-ctrl | |
mountPath: "/dev/nvhost-ctrl" | |
- name: nvhost-ctrl-gpu | |
mountPath: "/dev/nvhost-ctrl-gpu" | |
- name: nvhost-prof-cpu | |
mountPath: "/dev/nvhost-prof-cpu" | |
- name: nvmap | |
mountPath: "/dev/nvmap" | |
- name: nvhost-gpu | |
mountPath: "/dev/nvhost-gpu" | |
- name: nvhost-as-gpu | |
mountPath: "/dev/nvhost-as-gpu" | |
# libraries mapping | |
- name: aarch64-libs | |
mountPath: "/usr/lib/aarch64-linux-gnu" | |
- name: cuda-libs | |
mountPath: "/usr/local/cuda/lib64" | |
# datadir mapping | |
- name: datadir | |
mountPath: "/image-data" | |
restartPolicy: "Never" | |
volumes: | |
# nvidia devices | |
- name: nvhost-ctrl | |
hostPath: | |
path: /dev/nvhost-ctrl | |
- name: nvhost-ctrl-gpu | |
hostPath: | |
path: /dev/nvhost-ctrl-gpu | |
- name: nvhost-prof-cpu | |
hostPath: | |
path: /dev/nvhost-prof-cpu | |
- name: nvmap | |
hostPath: | |
path: /dev/nvmap | |
- name: nvhost-gpu | |
hostPath: | |
path: /dev/nvhost-gpu | |
- name: nvhost-as-gpu | |
hostPath: | |
path: /dev/nvhost-as-gpu | |
# libraries | |
- name: aarch64-libs | |
hostPath: | |
path: /usr/lib/aarch64-linux-gnu | |
- name: cuda-libs | |
hostPath: | |
path: /usr/local/cuda/lib64 | |
# datadir | |
- name: datadir | |
hostPath: | |
path: /ssd/image-data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment