Star64: GPU firmware loading on Armbian
#11
(06-08-2023, 10:30 PM)Fishwaldo Wrote: if you want a practical proof of the GPU "working" do this:
Load my desktop image (or kernel on armbian etc) and execute in a terminal window
"cat /sys/kernel/debug/pvr/status" and then do move some windows or play a video:
"Every 2.0s: cat /sys/kernel/debug/pvr/status                                                                                                                                                          star64: Fri Jun  9 04:49:23 2023

Driver Status:  OK

Device ID: 0:128
Firmware Status: OK
Server Errors:  0
HWR Event Count: 0
CRR Event Count: 0
SLR Event Count: 0
WGP Error Count: 0
TRP Error Count: 0
FWF Event Count: 0
APM Event Count: 243
GPU Utilisation: 93%
"

Now do the same with your Framebuffer app, and not that the GPU utilization does not go above 0%.

I've written both framebuffer apps and X apps, so these details are already familiar.

However when I was running X and seeing it run slow and with artifacts, I was using xterm, xconsole, and the Motif window manager, none of which use any part of Mesa,
and X claimed in its log to be using the "fb" device, so it shouldn't have been trying to use an 3D objects and textures to place windows. In fact, it didn't so any such thing because if you watch what happens when I moved a window, it didn't slide like a 3D object would.

Here is the evidence again in case you missed it:
https://youtu.be/Le2g9Kx-pjI

And of course, the fbdev test program that I ran, if it wasn't using any part of the GPU, should not have displayed any out-of-order drawing, but it did.
Therefore it seems it is the GPU driver which is providing /dev/fb0 functionality but that driver is buggy.
  Reply
#12
It's not that bad, with the right setup, even the soft mode works well enough and can use Star64 as a mini PC with DE without HW GPU. For example, can even watch videos in windowed mode. In any case, there are no strong brakes when using DE XFCE\Icewm normally. can try these images and make sure that DE works.

https://forum.armbian.com/topic/28912-star64-jh7110/

p.s. Even on the first variant of VF1 (jh7100) without GPU at all, I can work with DE acceptably. Smile
  Reply
#13
(06-03-2023, 01:01 PM)Der Geist der Maschine Wrote: GPU firmware loading fails on armbian:

Code:
[    0.698528] PVR_K:(Fatal):    1: All RGX Firmware image loads failed for 'rgx.fw.36.50.54.182' (PVRSRV_ERROR_NOT_FOUND) [1599]
[    0.698565] PVR_K:(Error):    1: RGXInit: InitFirmware failed (275) [1556]
[    0.698592] PVR_K:(Error):    1: RGXInit() failed (PVRSRV_ERROR_NOT_FOUND) in PVRSRVCommonDeviceInitialise() [2156]
[    0.698626] PVR_K:(Error):    1: PVRSRVDeviceFinalise() failed (PVRSRV_ERROR_NOT_INITIALISED) in PVRSRVCommonDeviceInitialise() [2170]
[    0.698664] [drm:pvr_drm_load] *ERROR* device (____ptrval____) initialisation failed (err=-19)

This is probably a first step in having GPU support in Xorg and Wayland.

Apply this kernel patch

Code:
schaecsn@pc:~/risc/linux# git diff drivers/gpu/drm/img/img-rogue/Kconfig
diff --git a/drivers/gpu/drm/img/img-rogue/Kconfig b/drivers/gpu/drm/img/img-rogue/Kconfig
index 5b793bb9da0e..6f84a2643e02 100644
--- a/drivers/gpu/drm/img/img-rogue/Kconfig
+++ b/drivers/gpu/drm/img/img-rogue/Kconfig
@@ -1,5 +1,5 @@
config DRM_IMG_ROGUE
-      bool "DRM support for PowerVR GPU"
+      tristate "DRM support for PowerVR GPU"
        select DRM_IMG
        default n
        help


Configure the gpu driver as a module

Code:
schaecsn@pc:~/riscv/linux$ scripts/config -m CONFIG_DRM_IMG_ROGUE


Rebuild the kernel and modules and install them.

The driver needs to be compiled as a kernel module. Unsophisticated guess: that moves out the initialization of the gpu from initrd into systemd-land. That is why the firmware does not need to be in initrd but can reside on the /-filesystem.

The two firmware blobs rgx.fw.36.50.54.182  rgx.sh.36.50.54.182 need to be moved into /lib/firmware/ directory. They come from starfive-'s github repro https://media.githubusercontent.com/medi...866.tar.gz

Code:
schaecsn@star64:~$ sudo mv img-gpu-powervr-bin-1.17.6210866/target/lib/firmware/* /lib/firmware/


A reboot shows successful firmware load

Code:
[  26.414834] PVR_K:  362: Read BVNC 36.50.54.182 from HW device registers
[  26.414879] PVR_K:  362: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[  26.422574] PVR_K:  362: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[  26.442903] PVR_K:  362: Shader binary image 'rgx.sh.36.50.54.182' loaded


Th next step in having GPU support in Xorg and Wayland is probably installing the libs, bin, and headers from said img-gpu-powervr-bin-1.17.6210866.tar.gz "[this] is a GPU library packages from Imagination and provide GPU firmware, libOpenCL, vulkan, gles2, gles3. This library is not open source, only provide with binary library." I have not tried that.

(06-06-2023, 12:12 AM)Fishwaldo Wrote: This is where you are going to have lots of "fun" - GPU support requires tons of patches to various userland apps, including mesa, wayland, apps etc to correctly use the GPU. The challenge is the patches starfive distribute are for older versions of userspace, namely mesa, that don't apply to current mainline (same issue for VPU as well). I tried to build GPU acceleration initially on debian, but ran in version dependency nightmares... newer apps wont compile against older mesa versions etc etc etc. I gave up and went with yocto as its not as "fussy" about version dependencies and is easier to overcome

Xorg is going to be very "challenging", and i've not started on it yet, as wayland is easier go get running with GPU.

The setup in the form of a firmware module is loaded, but there is no output to the monitor, even to the console

Code:
[   38.232439] mailbox_test mailbox_client: Successfully registered
[   41.669558] @@ dev ptr:ffffffe0bfedac00/1500/1
[   41.669717] PVR_K:  272: Read BVNC 36.50.54.182 from HW device registers
[   41.669766] PVR_K:  272: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[   41.705177] PVR_K:  272: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[   41.728503] PVR_K:  272: Shader binary image 'rgx.sh.36.50.54.182' loaded
[   41.730429] [drm] Initialized pvr 1.19.6345021 20170530 for 18000000.gpu on minor 1
[   42.423200] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.
donation   irradium

  Reply
#14
(09-11-2023, 11:09 AM)mara Wrote:
Code:
[   38.232439] mailbox_test mailbox_client: Successfully registered
[   41.669558] @@ dev ptr:ffffffe0bfedac00/1500/1
[   41.669717] PVR_K:  272: Read BVNC 36.50.54.182 from HW device registers
[   41.669766] PVR_K:  272: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[   41.705177] PVR_K:  272: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[   41.728503] PVR_K:  272: Shader binary image 'rgx.sh.36.50.54.182' loaded
[   41.730429] [drm] Initialized pvr 1.19.6345021 20170530 for 18000000.gpu on minor 1
[   42.423200] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.

fixed
donation   irradium

  Reply
#15
The patches available are for old software versions.
Skysmotor sells the following products online: Nema 17 Motor, Nema 23 Motor, Hybrid Stepper Motor, Stepper Motor and can be purchased online if needed.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Star64] Help needed in understanding Yocto and U-boot build process InterestedinFOSS 0 631 04-23-2024, 10:58 AM
Last Post: InterestedinFOSS
  Star64 JH7110 (slarm64, riscv64) mara 2 1,705 10-09-2023, 03:43 AM
Last Post: mara
  Star64: jtag debugging? bluepill 1 1,495 09-20-2023, 08:26 AM
Last Post: bwooster0
  Star64: 4GB on 8GB boards Der Geist der Maschine 4 3,043 07-27-2023, 12:32 AM
Last Post: balbes150
  Star64: SATA Der Geist der Maschine 1 1,511 07-26-2023, 12:35 PM
Last Post: Gladox114
Information Star64: Armbian Installation Der Geist der Maschine 5 6,236 06-03-2023, 01:26 PM
Last Post: Der Geist der Maschine
  Star64: a first benchmark Der Geist der Maschine 0 2,392 05-29-2023, 01:00 PM
Last Post: Der Geist der Maschine
  Star64 first boot (and success) bortzmeyer 1 2,184 05-24-2023, 02:45 AM
Last Post: draintroup

Forum Jump:


Users browsing this thread: 1 Guest(s)