Most GPU applications like TensorFlow, PyTorch or Blender need the NVIDIA CUDA toolkit in order to perform GPU computations.
Checking for CUDA
You can check if a system already has the NVIDIA CUDA toolkit installed and which version by running:
The following page contains all the information on installing CUDA https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html.
Please note that a regular CUDA installation will also ask to (re-)install the NVIDIA GPU driver.
nvidia-smi. Which should report all your instance GPUs.
Choose the CUDA toolkit version that you would like to install from the Nvidia Developer Page and follow the instructions, e.g. to download CUDA 11.7 run:
sudo sh cuda_11.7.0_515.43.04_linux.run --silent --toolkit
--silent flag suppresses all output to the command line and the
--toolkit flag makes sure that only the toolkit (not the drivers) are installed. Run the command without these flags if you do want to install the drivers. Make sure to only select a driver for installation, if you have not installed one already as reinstallation can lead to problems. To finish up two variables need to be added to the bottom of your .
For changes to take effect you need to execute these commands outside of .bashrc or by restarting your shell. Finally you can check whether everything worked out by calling: