You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
658 B
Plaintext

#!/bin/sh
for version in "1.15.*" "2.1.*"; do
for requirement in "tensorflow==$version" "tensorflow-gpu==$version"; do
for CUDA_VISIBLE_DEVICES in "0" ""; do
echo "== $requirement, CUDA_VISIBLE_DEVICES='$CUDA_VISIBLE_DEVICES'"
export CUDA_VISIBLE_DEVICES
venv=`mktemp -d /tmp/test-nvidia.XXXXX`
virtualenv --quiet -p /usr/bin/python3 $venv
. $venv/bin/activate
pip3 install --quiet --upgrade pip
pip3 install --quiet "$requirement"
python3 -c 'import tensorflow as tf; print("GPU available:", tf.test.is_gpu_available())'
deactivate
rm --preserve-root -rf "$venv/"
done
done
done