Products > Embedded Computing
Raspberry PI 4 Model B and hardware graphics acceleration
radiolistener:
Just got Raspberry PI 4 Model B 4 GB. But hdmi cable and hdmi/dvi converter is still in transit. So I'm using VNC connection through WiFi.
I'm using latest Raspberry PI OS x64 2023-05-03-raspios-bullseye-arm64.img
Just stuck with graphics hardware acceleration, I'm trying to run OpenGL app which needs hardware acceleration. But it seems that Open GL works with software renederer, so the app performance is very-very slow (0.1 fps).
I read that Open GL acceleration can be enabled with raspi-config from Advanced Options -> A2 GL driver. But that option is missing from my raspi-config. Some peoples wrote that there is some major changes in Raspberry PI 4, but it's not clear how to enable Open GL acceleration now. Can anybody help?
Here is inxi -Gx output:
--- Code: ---Graphics:
Device-1: bcm2711-hdmi0 driver: vc4_hdmi v: N/A bus ID: N/A
Device-2: bcm2711-hdmi1 driver: vc4_hdmi v: N/A bus ID: N/A
Device-3: bcm2711-vc5 driver: vc4_drm v: N/A bus ID: N/A
Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting
unloaded: fbdev s-res: 1280x1024
OpenGL: renderer: V3D 4.2 v: 2.1 Mesa 20.3.5 direct render: Yes
--- End code ---
In my app glGetString(GL_RENDERER) returns "V3D 4.2".
I'm not sure if it means that it uses hardware renderer or software one, but performance of my app is definitely too slow, also glxgears shows just 1 fps and youtube in firefox is too slow, so I suspect it uses software renderer.
Probably it may be slow because there is no display connected to HDMI outputs. But I'm not sure, because I cannot check it, currently I don't have HDMI cable and display and using it through SSH and VNC connection. Can somebody help to solve it?
This is my first raspberry pi, so I'm not familiar with their details. How to enable hardware acceleration for graphics on Raspberry PI 4?
radiolistener:
found that opengl acceleration exists. The problem with low frame rate is probably beacuse I connect through VNC and it works for 1 fps. I can check it when I get hdmi cable with DVI converter.
But found another two strange issues:
1) Chromium works with extreme high lags, but CPU load is almost zero... Any idea how to fix it?
2) cat /proc/cpuinfo shows the following:
--- Code: ---pi@raspi:~ $ cat /proc/cpuinfo
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
Hardware : BCM2835
Revision : c03115
Serial : 10000000********
Model : Raspberry Pi 4 Model B Rev 1.5
--- End code ---
Note that it shows BCM2835 CPU, but this is old single core CPU used in raspberry pi 1. Actual chip marking on my board is Broadcom 2711. WTF?
Whales:
Hardware accelerated OpenGL will probably only work with full Xorg. Default vncserver doesn't do that on my (desktop Radeon) computer, but I think there are workarounds like X0vnc which run a full Xorg server + vnc watching it.
--- Quote ---1) Chromium works with extreme high lags, but CPU load is almost zero... Any idea how to fix it?
--- End quote ---
Could be related to the above, not sure. Test with a real monitor as a comparison.
--- Quote ---Note that it shows BCM2835 CPU, but this is old single core CPU used in raspberry pi 1. Actual chip marking on my board is Broadcom 2711. WTF?
--- End quote ---
It's wrong. It looks like it's a hardcoded string in your kernel, not actually from the CPU.
https://github.com/raspberrypi/linux/issues/3022
thermistor-guy:
--- Quote from: radiolistener on July 27, 2023, 12:08:17 am ---Just got Raspberry PI 4 Model B 4 GB. But hdmi cable and hdmi/dvi converter is still in transit. So I'm using VNC connection through WiFi.
I'm using latest Raspberry PI OS x64 2023-05-03-raspios-bullseye-arm64.img
...
--- End quote ---
I tried PiOS and Ubuntu on an rpi4 with 8GB, without much success. So now I'm running Debian server (Bookworm) 64-bit,
XFCE desktop, and tightvnc server on it. Works for me. The rpi4 is running headless, wifi off, gigabit ethernet on.
Just now I connected to it from a Win7+Cygwin PC, using Tigervnc viewer over an ssh tunnel. Started firefox on the rpi,
used it to watch a Tom and Jerry cartoon on YT, 720p quality, for research purposes of course. Works well enough.
So if you can't get PiOS to work, give Debian + XFCE a try.
radiolistener:
--- Quote from: Whales on July 28, 2023, 04:16:43 am ---Hardware accelerated OpenGL will probably only work with full Xorg. Default vncserver doesn't do that on my (desktop Radeon) computer, but I think there are workarounds like X0vnc which run a full Xorg server + vnc watching it.
--- End quote ---
it works :)
It seems that the problem is that I don't have display, so it don't know refresh rate and limit it for 1 fps for some unknown reason.
I tried to disable vblank sync mode for process with vblank_mode=0 in command line and it works. See screenshot. :)
Well, speed is much slower than I was expected, but almost usable. And it even provides 4x hardware multisample filtering.
Any idea on how to improve Open GL hardware acceleration performance on raspberry pi 4? I want a little faster graphics... :)
--- Quote from: Whales on July 28, 2023, 04:16:43 am ---
--- Quote ---1) Chromium works with extreme high lags, but CPU load is almost zero... Any idea how to fix it?
--- End quote ---
Could be related to the above, not sure. Test with a real monitor as a comparison.
--- End quote ---
Yes, it seems that this problem is due to frame rate is 1 Hz for VNC. I tried to run it with manual vblank sync mode override and lags almost disappears, now chromium is usable and I'm writing this post from my raspberry pi 4 in chromium :)
I run it in the following way:
--- Code: ---vblank_mode=0 chromium-browser
--- End code ---
But before this I was installed the following packages:
--- Code: ---sudo apt-get install libgles2-mesa libgles2-mesa-dev xorg-dev mesa-utils freeglut3-dev
--- End code ---
and also enabled flag "Out-of-process 2D canvas rasterization." on chrome://flags page. It really helps to enable hw acceleration for out-of-process rasterization (can be checked on chrome://gpu page). So these tweaks may have effect.
Some people wrote that replace this string in /boot/config.txt:
--- Code: ---dtoverlay=vc4-kms-v3d-pi4,cma-256
--- End code ---
with this one
--- Code: ---dtoverlay=vc4-fkms-v3d-pi4,cma-256
--- End code ---
And it helps on some older version of raspi os. This change leads to switch from Full KMS video driver to a so called Fake KMS video driver. But I didn't tried it because it already works with Full KMS driver which is more fresh and supports more features.
--- Quote from: Whales on July 28, 2023, 04:16:43 am ---
--- Quote ---Note that it shows BCM2835 CPU, but this is old single core CPU used in raspberry pi 1. Actual chip marking on my board is Broadcom 2711. WTF?
--- End quote ---
It's wrong. It looks like it's a hardcoded string in your kernel, not actually from the CPU.
--- End quote ---
Probably you're right. But it also displays info about cores and part of that info is correct.
I run a little code to read info directly from CPU registers and it shows the following on my rpi 4:
--- Code: ---MIDR_EL1: 0x410fd083
[Reserved]: 0x0
Implementer: 0x41
Variant: 0x0
Architecture: 0xf
PartNum: 0xd08
Revision: 0x3
VPIDR_EL2: SIGILL
REVIDR_EL1: 0
ID_AA64ISAR0_EL1: 0x10000
ID_AA64ISAR1_EL1: 0
MVFR0_EL1: 0x200
MVFR1_EL1: 0x10011100
MVFR2_EL1: 0
--- End code ---
[/quote]
So, my rpi 4B CPU has MIDR_EL1=0x410fd083. I read that other people also seen such code for rpi 4.
But first rpi 4 models had MIDR_EL1 with different last two digits and cpuinfo.
Any other idea on how to identify actual CPU are welcome.
PS: posted this message from my rpi 4 :)
Navigation
[0] Message Index
[#] Next page
Go to full version