PINE64
NixOS image with panfrost - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98)
+--- Forum: Linux on RockPro64 (https://forum.pine64.org/forumdisplay.php?fid=101)
+--- Thread: NixOS image with panfrost (/showthread.php?tid=7906)



NixOS image with panfrost - Thra11 - 08-31-2019

I've recently installed NixOS on my RockPro64, and since I've got the panfrost driver working, I thought I'd create a bootable image so that people can give it a try with minimal effort. Simply download and extract the image here and write it to an sd-card or eMMC using your favourite disk image writing tool (The image is 4.7GB, so you'll probably need an 8GB or larger SD card/eMMC). It should boot and automatically log into the KDE plasma desktop. (user is called rockpro64, password rockpro64). It uses the 5.3 ayufan-rock64/linux-mainline-kernel. It takes a minute or two to boot, so you may wish to follow its progress via the UART if you can.

This image can be used as an installer: simply follow the instructions in the NixOS wiki to create /etc/nixos/configuration.nix and run nixos-rebuild. If you'd prefer to build your own image, RockPro64-specific information can be found here.


Note: Normally, NixOS fetches most packages from a binary cache. However, since this image uses a different version of mesa, anything which depends on mesa (basically any graphical application) will be built from source.


RE: NixOS image with panfrost - tuxd3v - 08-31-2019

(08-31-2019, 05:06 AM)Thra11 Wrote: I've recently installed NixOS on my RockPro64, and since I've got the panfrost driver working, I thought I'd create a bootable image so that people can give it a try with minimal effort. Simply download and extract the image here and write it to an sd-card or eMMC using your favourite disk image writing tool (The image is 4.7GB, so you'll probably need an 8GB or larger SD card/eMMC). It should boot and automatically log into the KDE plasma desktop. (user is called rockpro64, password rockpro64). It uses the 5.3 ayufan-rock64/linux-mainline-kernel. It takes a minute or two to boot, so you may wish to follow its progress via the UART if you can.

Hello Thra11,
I am still planning for mainline 5.3 + Panfrost..
thanks for sharing  Shy

What are your initial toughs about Panfrost vs proprietary driver, speed/processing power/etc( if you had compared them, in some way )?

Regards,


RE: NixOS image with panfrost - kolbycrouch - 09-24-2019

Hi. I'm trying to use this image as an installer onto a nvme ssd. I've been working through trial and error mostly because of my lack of familiarity with nixos.

My main problem is that the console output doesn't show and the screen doesn't turn on until X is started. Is there a way to change this?

I don't want X on the install, but I'm not even sure if the install is working or not because all I get is a black screen.


RE: NixOS image with panfrost - Thra11 - 09-27-2019

Just to clarify, is it the original SD/eMMC image which doesn't appear to finish booting, or just the install on NVMe SSD?

kolbycrouch Wrote:My main problem is that the console output doesn't show and the screen doesn't turn on until X is started. Is there a way to change this?
In theory, it should be possible to get hdmi output much earlier in boot. In common with most non-NixOS linuxes, boot has 3 main stages:
0. U-Boot
1. NixOS Stage 1 - kernel runs using initrd as rootfs
2. NixOS Stage 2 - kernel switches to real rootfs

U-boot should support hdmi output, although 1. the u-boot used in this image is the rockchip fork, and 2. I haven't checked whether u-boot supports hdmi output for the RK3399 yet.

In terms of the kernel outputting information on the screen, I think it
a) needs to have the right console=something (and possibly others such as earlycon) arguments in the kernel command line, to tell it that we want the console on the video output instead of (or as well as) on the UART.
b) needs to have loaded the kernel modules necessary to start KMS (Kernel Mode Setting) to use the hdmi output. Doing 'early kms' (hdmi output during Stage 1) should be possible, by putting the required modules in boot.initrd.availablekernelmodules. (Aside: if the NVMe adaptor or the filesystem used on the SSD require any additional modules, then these need to be added to this list, so that Stage 1 is able to mount the real rootfs needed for Stage 2).

I'm hoping to take a proper look at this myself at some point. If you do have some sort of USB serial adaptor (doesn't have to be the Pine64 one, as long as it's the correct voltage), it's a great help for these sorts of things.


RE: NixOS image with panfrost - kolbycrouch - 11-03-2019

(09-27-2019, 08:05 AM)Thra11 Wrote: Just to clarify, is it the original SD/eMMC image which doesn't appear to finish booting, or just the install on NVMe SSD?

kolbycrouch Wrote:My main problem is that the console output doesn't show and the screen doesn't turn on until X is started. Is there a way to change this?
In theory, it should be possible to get hdmi output much earlier in boot. In common with most non-NixOS linuxes, boot has 3 main stages:
0. U-Boot
1. NixOS Stage 1 - kernel runs using initrd as rootfs
2. NixOS Stage 2 - kernel switches to real rootfs

U-boot should support hdmi output, although 1. the u-boot used in this image is the rockchip fork, and 2. I haven't checked whether u-boot supports hdmi output for the RK3399 yet.

In terms of the kernel outputting information on the screen, I think it
a) needs to have the right console=something (and possibly others such as earlycon) arguments in the kernel command line, to tell it that we want the console on the video output instead of (or as well as) on the UART.
b) needs to have loaded the kernel modules necessary to start KMS (Kernel Mode Setting) to use the hdmi output. Doing 'early kms' (hdmi output during Stage 1) should be possible, by putting the required modules in boot.initrd.availablekernelmodules. (Aside: if the NVMe adaptor or the filesystem used on the SSD require any additional modules, then these need to be added to this list, so that Stage 1 is able to mount the real rootfs needed for Stage 2).

I'm hoping to take a proper look at this myself at some point. If you do have some sort of USB serial adaptor (doesn't have to be the Pine64 one, as long as it's the correct voltage), it's a great help for these sorts of things.

Yea I figured out the need for those modules, but oddly placing them in boot.initrd.kernelmodules only loads them after initrd, or atleast I don't get display until ~getty. It also takes a good while to boot ( to get to login prompt or display-manager ) but I haven't analyzed why.

My other problem was a case of me being unfamiliar with nixos, I've since figured it out. Now I'm running NixOS on a f2fs nvme with mesa 19.3 and kernel 5.3.8 Big Grin

Have you tried upstreaming the expressions for generating the image or the kernel? The kernel is easy enough, but I wouldn't have bothered with nixos without the help of your image, and after seeing several other boards supported upstream I was going to try to make a PR but thought I'd ask you if you'd done that or would mind me doing it.