This procedure has been tested on Fedora 28, on a HP laptop with this graphical card: NVIDIA Corporation GP107M GeForce GTX 1050 Mobile (rev a1).

The commands have to be run as the root user. This tutorial assumes the nvidia driver is already working.

Install pip #

dnf install python3-pip

Install Cuda #

We install cuda 9.0 as it is the latest version supported by tensorflow at the time of writing.

sh cuda_9.0.176_384.81_linux-run

You will have a few choices. Select “install cuda”, don’t install samples or drivers.Select “create a symbolic link”. You can set the TMPDIR en variable before executing the script to select the location of the temporary folder used during the installation. Can be used if the default, /tmp, is not large enoguh.

Install cudnn #

dnf install python3-pip
tar -xvf cudnn-9.0-linux-x64-v7.tgz
cp cudnn.h /usr/local/cuda-9.0/include/cudnn.h
cp /usr/local/cuda/lib64/
ln -s /usr/local/cuda/lib64/ /usr/local/cuda/lib64/
ln -s /usr/local/cuda/lib64/ /usr/local/cuda/lib64/

Update environment variables #

So your compiler can find the installed libraries:

cat >> ~/.bashrc << EOF
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export CUDA_HOME=/usr/local/cuda
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/cuda/samples/common/inc

Install GCC 5 #

Cuda 9.0 requires a GCC version inferior <= 6. We install GCC 5 from mageia packages as Fedora does not provide old packages for GCC.

cat >> ~/.bashrc << EOF
wget \ \ \

rpm -ivh --force --nodeps *.rpm
` You can test the installation by running:

cd /usr/local/cuda/samples/1_Utilities/deviceQuery

You should see Result = PASS in the output

Install pytorch #

pip3 install
pip3 install torchvision

Install Tensorflow #

pip3 install tensorflow-gpu