Created
May 11, 2017 16:31
-
-
Save everpeace/9e03050467d5ef5f66b7ce96b5fefa72 to your computer and use it in GitHub Desktop.
Revisions
-
everpeace created this gist
May 11, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ kind: Pod apiVersion: v1 metadata: name: gpu-pod spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: alpha.kubernetes.io/nvidia-gpu-name operator: In values: - Tesla_K80 containers: - name: gpu-container image: gcr.io/tensorflow/tensorflow:latest-gpu imagePullPolicy: Always command: ["python"] args: - -u - -c - | import tensorflow as tf;a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a');b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b');c = tf.matmul(a, b);sess = tf.Session(config=tf.ConfigProto(log_device_placement=True));print(sess.run(c)) resources: requests: alpha.kubernetes.io/nvidia-gpu: 1 limits: alpha.kubernetes.io/nvidia-gpu: 1 volumeMounts: - name: nvidia-driver-375-66 mountPath: /usr/local/nvidia readOnly: true - name: libcuda-so mountPath: /usr/lib/x86_64-linux-gnu/libcuda.so - name: libcuda-so-1 mountPath: /usr/lib/x86_64-linux-gnu/libcuda.so.1 - name: libcuda-so-375-66 mountPath: /usr/lib/x86_64-linux-gnu/libcuda.so.375.66 restartPolicy: Never volumes: - name: nvidia-driver-375-66 hostPath: path: /opt/nvidia/current - name: libcuda-so hostPath: path: /opt/nvidia/current/lib/libcuda.so - name: libcuda-so-1 hostPath: path: /opt/nvidia/current/lib/libcuda.so.1 - name: libcuda-so-375-66 hostPath: path: /opt/nvidia/current/lib/libcuda.so.375.66