NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.62k stars 13.77k forks source link

add gpu support for glances #292130

Open beh-10257 opened 7 months ago

beh-10257 commented 7 months ago

Describe the bug

installing any of these pkgs should probably fix the problem python311Packages.py3nvml python310Packages.py3nvml python3Packages.py3nvml

but well it doesn't btw how to know if gpu support exists supposedly press 6

Steps To Reproduce

Steps to reproduce the behavior:

  1. press 6

Expected behavior

gpu support should work

Notify maintainers

@jonringer @primeos @k0ral

question

if installing those pkgs should help tell me the right way to do it

Add a :+1: reaction to issues you find important.

beh-10257 commented 7 months ago

like I am using this overlay

{ pkgs, ... }:
let
myglances = pkgs.glances.overrideAttrs (old: {
      propagatedBuildInputs = (old.propagatedBuildInputs or []) ++ (with pkgs.python3Packages; [pygal py3nvml]);
    });
in
{
  environment = {
    systemPackages = with pkgs; [
      myglances
    ];
  };
}

and that actually makes glances --export graph work so my problem here is making the gpu plugin work as well basically I want glances --meangpu -d to show me gpu stuff or just checking the logs after glances -d I don't wanna see this image in .cache/glances/glances.log

nixos-discourse commented 7 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-add-optional-dependencies-the-generic-way/40597/1

Kiskae commented 7 months ago

It looks like py3nvml hasn't been maintained for years and hasn't been patched for nixos like pynvml is. I'm not sure why glances uses that library, but it should be fairly easy to port the patch to py3nvml: https://github.com/NixOS/nixpkgs/blob/068d4db604958d05d0b46c47f79b507d84dbc069/pkgs/development/python-modules/pynvml/default.nix#L20-L25