Open HeroBrine1st opened 4 months ago
Mali G610 is just landed to Mesa 24.1. Probably we can go without panfork after nixpkgs have mesa 24.1.
If someone is less lazy than me to get their server Orange Pi from under the table or already have long enough HDMI cable, try hardware.opengl.package = lib.mkForce pkgs.mesa
after Mesa 24.1 lands to nixpkgs. I'm going to test it too, but I probably will be postponing it until the sun dies.
This issue will be avoided (because panfork is not used), so you'll be sure that it uses mainstream mesa.
UPD: Actually, Mesa 24.1 is experimental, so we wait for 24.1.1 :-( Or override src and build locally
Mesa 24.1.1 is just landed to unstable channel. I did no tests though.
I did some tests. Using X11 forwarding, I got "Error: couldn't get an RGB, Double-buffered visual x11 forwarding" for glxgears.
Then I got OPi 5 on the table and did proper tests with proper configuraton. Got highly distorted image (green rectangle of 1/3 screen size on bottom, rendered picture stretched like on three monitors with single-pixel horizontal gaps filled with pixels from other regions and skipped pixels on vertical, making text highly distorted and unreadable), otherwise FPS was "ok". I took a screenshot, but it looks normal.
I did not see any hardware acceleration. There was no animations, and GNOME disables them when it falls back to software, so it obviously skipped it. I think the reason behind that is linux version requirement (6.6 minimum iirc), but I can't confirm that (no dmesg messages, nothing).
Could someone with panfork-mesa and hardware accelerated DE share their configuration? And it would be good if you confirm that x11 forwarding with glxgears works, because I'd rather not move my opi5 again.
I'll also probably keep and eye on armbian folks. Probably. I don't need OpenGL, so I did all that from pure curiosity.
I use UEFI btw, in device tree mode as said in UEFI.md.
UPD: A week passed, and I realized that the "proper configuration" used old mesa 24.0.7. I forgot about flake.lock. What a shame.
I tested again:
{ pkgs, lib, ... }: {
hardware.graphics.enable = true;
hardware.graphics.package = lib.mkForce pkgs.mesa.drivers;
environment.systemPackages = [
pkgs.mesa-demos
];
services.xserver.enable = true;
services.xserver.videoDrivers = [ "panfrost" ];
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
}
This time mesa was 24.1.1 (I even ran nix flake update on target host to confirm that), and I also added panfrost driver (services.xserver.videoDrivers). Still stretched image, so I didn't even log in via gdm as it is obvious panfrost is not loaded.
dmesg | grep panfrost
still shows no output, even after modprobe panfrost
.
Also nixpkgs deprecated hardware.opengl in favor of hardware.graphics, but this shouldn't be an issue.
UPD: Panthor driver is also required - we don't have it in our kernel.
Hi
First, the actual issue:
This happens when you add
hardware.opengl.enable = true
to system configuration.Aforementioned file is required here:
https://github.com/ryan4yin/nixos-rk3588/blob/349f39dcaafeb41250544bcc066db8668a7762ce/modules/boards/base.nix#L70-L79
To be clear, I use this flake as input for my flake and installed NixOS directly on SSD.
I.e. I installed it like that
```nixos { description = "NixOS configuration"; inputs = { unstable.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-23.11"; nixos-rk3588.url = "github:ryan4yin/nixos-rk3588?rev=349f39dcaafeb41250544bcc066db8668a7762ce"; }; outputs = { nixpkgs, nixos-rk3588, ... }: let # using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache. inherit (nixos-rk3588.inputs) nixpkgs; system = "aarch64-linux"; in { nixosConfigurations = { opi5 = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { rk3588 = { inherit nixpkgs; pkgsKernel = import nixpkgs { inherit system; }; }; }; modules = [ nixos-rk3588.nixosModules.orangepi5.core # nixos-rk3588.nixosModules.orangepi5.sd-image ./system/configuration.nix ./system/hardware-configuration.nix ]; }; }; }; } ``` And configuration/hardware configuration is just like on flakeless system. (P.s. I'm new to NixOS, I have been installing this flake for 2 days (mostly due to 5 SD cards that have died in process) but it does work normally for my "home enterprise")Second, my background research about this issue
Looks like panfork/mesa is gone without any information about that. After two days of searching I found this PR which explains almost everything.
Basically, panfork/mesa is gone due to personal nature of its maintainer. Also, AUR package mesa-panfork-git was available yesterday but is deleted today. Looks like panfork removal is just started so that I'm first to notice it.
There's also tsukumijima/libmali-rockchip that is mentioned in jellyfin PR. Some parts of it are probably needed for this flake to work with mainline Mesa, because Mesa probably already supports it. Again, probably - I'm a total noob in such hardware. I simply got excited that there's a working ffmpeg included in nightly jellyfin and now I'm frustrated.
And also there's a soft fork of panfork/mesa on github. I don't trust that and I'm honestly pretty suspicious of this fork, but seems like it is the same exact code and you can swap it clean and it'll work.
I leave this for other people's time sake for now.