Skip to content
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

nvidia-container-toolkit-cdi-generator should not mount nvidia-powerd when nvidia driver == 470 #319201

Closed
DictXiong opened this issue Jun 12, 2024 · 1 comment · Fixed by #319772
Assignees
Labels
0.kind: bug Something is broken

Comments

@DictXiong
Copy link
Contributor

DictXiong commented Jun 12, 2024

Describe the bug

The nvidia-container-toolkit-cdi-generator service will ask docker to mount the binary nvidia-powerd which is not provided by the Nvidia driver v470.

{ hostPath = lib.getExe' nvidia-driver "nvidia-powerd";

Using NixOS 24.05 with nixpkgs 47b604b0.

Steps To Reproduce

Steps to reproduce the behavior:

      nixpkgs.config.nvidia.acceptLicense = true;
      hardware.nvidia = {
        package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
        modesetting.enable = false;
        powerManagement.enable = true;
        powerManagement.finegrained = false;
        open = false;
        nvidiaSettings = true;
      };
      hardware.opengl = {
        enable = true;
        driSupport = true;
        driSupport32Bit = true;
      };
      hardware.nvidia-container-toolkit.enable = true;
      services.xserver.videoDrivers = [ "nvidia" ];

Expected behavior

nvidia-powerd should not be mounted when the binary is missing.

Screenshots

image image

Notify maintainers

@ereslibre

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.05 (Uakari), 24.05.20240611.47b604b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/0vpk9v6rj551q42ym4h9qrdx9xxxhcsg-source`

Edited: a workaround

      systemd.services.nvidia-container-toolkit-cdi-generator = {
        path = [ pkgs.jq pkgs.moreutils ];
        postStart = ''
         jq '."containerEdits"."mounts" |= map(select(."containerPath" != "/usr/bin/nvidia-powerd"))' /run/cdi/nvidia-container-toolkit.json | sponge /run/cdi/nvidia-container-toolkit.json
        '';
      };

Add a 👍 reaction to issues you find important.

@DictXiong DictXiong added the 0.kind: bug Something is broken label Jun 12, 2024
@DictXiong DictXiong changed the title nvidia-container-toolkit-cdi-generator make a mistake with nvidia driver 470 nvidia-container-toolkit-cdi-generator should not mount nvidia-powerd with nvidia driver 470 Jun 12, 2024
@DictXiong DictXiong changed the title nvidia-container-toolkit-cdi-generator should not mount nvidia-powerd with nvidia driver 470 nvidia-container-toolkit-cdi-generator should not mount nvidia-powerd when nvidia driver == 470 Jun 12, 2024
@ereslibre ereslibre self-assigned this Jun 12, 2024
@ereslibre
Copy link
Member

Thank you for the report @DictXiong. You can also set hardware.nvidia-container-toolkit.mount-nvidia-executables = false; in the meantime. I'll open a PR as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants