Skip to content

Instantly share code, notes, and snippets.

@rootfs
Created June 5, 2018 17:34
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save rootfs/aea15b78de5ada8a55702994d5106433 to your computer and use it in GitHub Desktop.
Save rootfs/aea15b78de5ada8a55702994d5106433 to your computer and use it in GitHub Desktop.

add python site

export PYTHONPATH=${PYTHONPATH}:/usr/lib64/python3.6

install cuda and nvdia driver

dnf config-manager --add-repo=http://negativo17.org/repos/fedora-nvidia.repo
# yum-config-manager --add-repo=http://negativo17.org/repos/epel-nvidia.repo
dnf install cuda-devel cuda-cudnn-devel
dnf install nvidia-settings kernel-devel dkms-nvidia vulkan nvidia-driver-libs nvidia-driver-cuda

install tensorflow gpu

conda install -c anaconda tensorflow-gpu

test

import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

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)
print(sess.run(c))

check if gpu is there

@satyajithj
Copy link

dnf install nvidia-driver-cuda installs CUDA version 9.2 from the the negativo17 repo. Right?
And tensorflow requires 9.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment