ryan4yin / nixos-rk3588

Minimal NixOS running on RK3588/RK3588s based SBC(Orange Pi 5 Plus, Orange Pi 5, Rock 5A, etc)
MIT License
152 stars 28 forks source link

Remove mesa panfork override #48

Closed phaitonican closed 1 month ago

phaitonican commented 1 month ago

Is not online anymore. It says use upstream, otherwise I get compilation error because 404 not found https://gitlab.com/panfork/mesa

does it still need this? and other stuff there?

          ...
          (pkgs.mesa.override {
            galliumDrivers = ["panfrost" "swrast"];
            vulkanDrivers = ["swrast"];
          })
         ...
HeroBrine1st commented 1 month ago

I have done some research about it and it there are some mirrors available, although I can't tell about their authenticity - https://github.com/ryan4yin/nixos-rk3588/issues/32

Recheckling that, I found that linked "mirror" is deleted too. I also remember that I saved it locally, but can't find it (deleted?).

Anyway, I think it should be replaced with throw. It doesn't work now and won't work even with this PR, and here's why: Panfrost driver needs a Panthor kernel driver, which is included into Linux 6.10 and newer. And, looking on armbian folks, I see that their "edge" kernel is lacking hardware support (would be good if I misunderstood).

P.s. Is there anybody with panfork driver? Does it actually work, like, can you use it for everyday tasks or even playing some light OpenGL games?

phaitonican commented 1 month ago

sorry did not wanna remove your part i just didnt know what it was doing. i reverted it back and just delete the gitlab part

phaitonican commented 1 month ago

I have done some research about it and it there are some mirrors available, although I can't tell about their authenticity - #32

Recheckling that, I found that linked "mirror" is deleted too. I also remember that I saved it locally, but can't find it (deleted?).

Anyway, I think it should be replaced with throw. It doesn't work now and won't work even with this PR, and here's why: Panfrost driver needs a Panthor kernel driver, which is included into Linux 6.10 and newer. And, looking on armbian folks, I see that their "edge" kernel is lacking hardware support (would be good if I misunderstood).

P.s. Is there anybody with panfork driver? Does it actually work, like, can you use it for everyday tasks or even playing some light OpenGL games?

I don't know really. So we need new kernel for this to work?... so unfortunate, i was getting everything to work

HeroBrine1st commented 1 month ago

maybe one of those options makes upstream mesa "work" idk really...

No, it won't, because it needs Panthor driver. You can't run Panfrost driver without Linux 6.10 or newer:

https://www.collabora.com/news-and-blog/news-and-events/release-the-panthor.html

But you can try incorporating armbian's edge kernel. I'm tempted to do that (particularly because of bcachefs), but I use my OPi5 as production server (mission-critical in a sense, non-commercial though - just self-hosting) and so I don't want to risk my system being fried or filesystem corrupted due to kernel panics.

sorry did not wanna remove your part i just didnt know what it was doing

Take it easy, it's no offence. That's why we have comments, after all.

Why Armbian Kernel not support this yet?

Looks like their Edge kernel does.


Btw, your latest change won't compile, It looks like opengl.package = ().drivers which won't work. Also, if we use mainstream Mesa drivers, I propose throwing error like that instead:

Patch ```diff - opengl.package = - ( - (pkgs.mesa.override { - galliumDrivers = ["panfrost" "swrast"]; - vulkanDrivers = ["swrast"]; - }) - .overrideAttrs (_: { - pname = "mesa-panfork"; - version = "23.0.0-panfork"; - src = pkgs.fetchFromGitLab { - owner = "panfork"; - repo = "mesa"; - rev = "120202c675749c5ef81ae4c8cdc30019b4de08f4"; # branch: csf - hash = "sha256-4eZHMiYS+sRDHNBtLZTA8ELZnLns7yT3USU5YQswxQ0="; - }; - }) - ) - .drivers + opengl.package = throw "OpenGL is not supported yet"; ```

But I think there are people with working panfork driver. If panfork is removed, it will remove it from their machines, although they have it cached in their /nix/store and so are not affected by repository removal. So it breaks OpenGL for some people for nothing. And that's why I did not submit a PR when I got this error, if you're curious.

Upstream nixpkgs somehow make warnings when they change package names, it should be useful here.


Also, looks like nix is new for you. I see that you want to test mainstream Mesa drivers, and that's how you do that:


{ pkgs, lib, ... }: {
  hardware.opengl.enable = true;
  hardware.opengl.package = lib.mkForce pkgs.mesa.drivers;
}

You can overwrite almost everything in your system without patching upstream flakes :upside_down_face:

phaitonican commented 1 month ago

Panthor needs CONFIG_DRM_PANTHOR=y kernel config line for armbian kernel as it is a module. I recompile now and check if it work... Idk how to "check", glxinfo says no display but it was without panthor. i will jsz try to get hyprland work