Last active
September 6, 2017 10:18
-
-
Save arcaduf/26f65454726ceb0cab0df4ff5d920578 to your computer and use it in GitHub Desktop.
Interactive GPU session with Slurm
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 characters
srun --partition gpu -I --pty /bin/bash -l | |
ml python2 | |
ml virtualenv | |
ml CUDA/8.0.44 | |
ml cuDNN/5.1-CUDA-8.0.44 | |
ml OpenCV/2.4.11-goolf-1.7.20 | |
ml TensorFlow/1.1.0-goolf-1.7.20-CUDA-8.0.44-Python-2.7.11 | |
# Check whether tensorflow-gpu works fine: | |
python | |
# in the python prompt type: | |
import tensorflow as tf | |
with tf.device('/gpu:0'): | |
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) | |
with tf.Session() as sess: | |
print (sess.run(c)) | |
# Check whether job is running fine: | |
squeue -u arcaduf | |
# Cancel job: | |
scancel "jobID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment