Initial commit

master
Gerber, Mike 5 years ago
commit ee7f6593d5

@ -0,0 +1,10 @@
FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
RUN apt-get update &&\
apt-get install -y python3 python3-pip &&\
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY requirements.txt /tmp
RUN pip3 install -r /tmp/requirements.txt
COPY test-nvidia /usr/bin
CMD ["/usr/bin/test-nvidia"]

@ -0,0 +1 @@
tensorflow-gpu == 1.14.0

5
run

@ -0,0 +1,5 @@
#!/bin/sh
virtualenv -p /usr/bin/python3 ~/.virtualenvs/test-nvidia
. ~/.virtualenvs/test-nvidia/bin/activate
pip3 install -r requirements.txt
python3 test-nvidia

@ -0,0 +1,3 @@
#!/bin/sh
docker build -t test-nvidia `dirname $0`
docker run --gpus all -it --rm test-nvidia

@ -0,0 +1,13 @@
#!/usr/bin/python3
import os
import tensorflow as tf
os.system('nvidia-smi')
hello = tf.constant('Hello, TensorFlow!')
sess = tf.compat.v1.Session()
print(sess.run(hello))
print('GPU available:', tf.test.is_gpu_available(cuda_only=True))
Loading…
Cancel
Save