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.
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
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.