To use GPU for PyTorch and Tensorflow, a method I grow fond of is to install GPU driver from RPM fusion, in particular, on Debian or Fedora systems where only free packages are included in their repositories. Via this method, we only install the driver from RPM fusion, and use Python virtual environment to bring in CUDA libraries.
- Configure RPM Fusion repo by following the instruction, e.g., as follows:
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- Install driver, e.g.,
sudo dnf install akmod-nvidia
- Add CUDA support, i.e.,
sudo dnf install xorg-x11-drv-nvidia-cuda
- Check driver by running
nvidia-smi
. If it complains about not being able to connect to the driver, reboot the system.
If we use PyTorch or Tensorflow only, there is need to install CUDA from Nvidia.
Reference
- https://rpmfusion.org/Configuration
No comments:
Post a Comment