Add ability to get driver from NVIDIA's official RHEL repository, to avoid version issues #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On certain distros, where the NVIDIA driver is typically installed via the NVIDIA driver repositories, trying to install the driver from the download site will commonly fail with a 404 error, like described in #170 and #124 and #67.
There have been approaches to solve this, e.g. in #184, but this will not work reliably. The key problem is that NVIDIA is not providing consistent versions of their drivers on different distribution channels. For Rocky Linux, and all other RHEL distros, the latest version on the download site differs. e.g. at the time of writing, the latest on downloads
.run
is 570.124.04, while the.rpm
version in the RHEL repository is 570.124.06:Driver download: https://download.nvidia.com/XFree86/Linux-x86_64/570.124.04/
RHEL repository: https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/nvidia-driver-libs-570.124.06-1.el9.x86_64.rpm
Using a different version, even if it's a small difference in the minor version, does not work in my experience. One could always manually install a driver, but in the case of RHEL it's way better to get the NVIDIA driver installed and updated via the default package manager and update cycle.
To solve this issue, I've created a fork with an additional derivation in nixGL, that gets the driver from the RHEL repository from the
.rpm
. This works well for me, and should solve the issue for RHEL users. It it would be nice if it could be merged.To get the driver from the RHEL
.rpm
instead of the driver download site, simply setdriverSource
torhel
. Also ensure thatenable32bits
is changed from its default tofalse
, as at this point I did not include the 32bit version of the driver. Here's an example from my.nix
usinghome-manager
:If you face the driver problem and you are on any RHEL distro like Rocky, Fedora, etc., you can use the nixGL overlay from my fork until this is merged:
Something similar can probably be done for Debian and other distros, using the official NVIDIA driver for a specific distro as the source for nixGL.
Fixes #170 #124 #67