Skip to content

Add ability to get driver from NVIDIA's official RHEL repository, to avoid version issues #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Aietes
Copy link

@Aietes Aietes commented Mar 11, 2025

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 set driverSource to rhel. Also ensure that enable32bits is changed from its default to false, as at this point I did not include the 32bit version of the driver. Here's an example from my .nix using home-manager:

{
  nixpkgs = {
    overlays = specialArgs.overlays;
    config = { allowUnfree = true; };
  };

  home.packages = with pkgs; [
    (nixgl.override {
      driverSource = "rhel";
      enable32bits = false;
    }).auto.nixGLDefault
    (config.lib.nixGL.wrap ghostty)
  ];

  nixGL = {
   packages = pkgs.nixgl.override {
    driverSource = "rhel";
    enable32bits = false;
   };
   defaultWrapper = "nvidia";
  };

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:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixgl = {
      url = "github:Aietes/nixGL/rhel";
    };
  };
  ....

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

@Aietes
Copy link
Author

Aietes commented Mar 11, 2025

Since it seems that the driver version is consistent across Debian, Fedora and RHEL, at least at this point, pulling the driver from the RHEL repository very likely also works on other distros, pending somebody testing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

404 error with latest Nvidia drivers
1 participant