I am using the imx8mp module on a custom carrier board. Torizon OS is based on your 6.7.
As far as I know vivante GPU is enabled both in the SDK and debug containers.
However, when running the application I get only 16 fps which makes the rendering look slow. If using a Yocto image based on your BSP I get around 60 fps. Is this normal?
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
To verify if the Vivante GPU is being utilized within your container on the iMX8MP module with Torizon OS, you can follow these steps:
Check for Vivante GPU Drivers in the Container: Ensure that the container has access to the Vivante GPU drivers. This can be done by checking the presence of /dev/dri or /dev/galcore inside the container. You can use the command ls /dev/dri or ls /dev/galcore within the container to verify their presence.
Use Vivante GPU Tools: Torizon provides containers with tools optimized for the Vivante GPU. You can use the viv_samples (if available in your SDK or debug containers) to run GPU-specific tests and benchmarks. Running these samples will not only confirm the GPU’s activity but also give you an insight into its performance.
Leverage Environment Variables: For applications utilizing the GPU, ensure that you have set the appropriate environment variables that many graphics applications require to use the GPU acceleration. For example, setting VIVANTE_GPU=1 or similar environment-specific variables that your application might require.
Debugging with gputop: Regarding the issues with gputop, the errors you encountered suggest a lack of necessary permissions or missing configurations for debugfs. Ensure that your container is run with the necessary privileges and has access to the host’s system resources. For gputop to function correctly, it needs access to debugfs mounted on /sys/kernel/debug. You can mount this directory into your container by adding -v /sys/kernel/debug:/sys/kernel/debug to your docker run command. Additionally, ensure that your container runs in privileged mode or with the necessary capabilities added to access hardware performance counters.
Comparing Performance with Yocto Images: If you observe a significant performance difference between the Torizon and Yocto-based images, ensure that both environments are configured similarly, especially regarding GPU drivers and acceleration libraries. Differences in driver versions, kernel configurations, or missing GPU acceleration libraries in the container could lead to performance discrepancies.
If after these steps, you still face issues or cannot confirm GPU utilization, it might be necessary to review the container’s configuration and ensure it’s correctly set up for GPU acceleration, including verifying the container’s base image and any Torizon-specific settings or optimizations for the Vivante GPU.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
Just to confirm, which application do you see this drop in framerate?
If you are using Chromium, I would recommend that you test it with GPU compositing disabled (--disable-gpu-compositing). We have seen performance improvements by changing this configuration.
In general, the performance in Torizon OS should be very similar to the Reference Multimedia Image, as the container has no significant overhead for most use cases.
Regarding being able to tell if the GPU is being used, there are a few different approaches that can be taken, such as:
Check the CPU usage, if it is too high, some sort of software rendering may be active
Use gputop, as you have setup, to see the GPU usage.
Please note that gputop has multiple pages and only one of them has the actual occupancy of the GPU. You can change the current page using the arrow keys.
I would also recommend that you test the system at idle first, to see what that looks like in gputop. The reason for this is that some earlier versions of gputop showed the GPU occupancy inverted, so when the GPU was idle it would show 100% load and when it was fully used it would show 0% load.
I am running a Qt5 application in a qt5-wayland-vivante based container. The CPU load is low and balanced.
Is there a similar option such as the one you mentioned for Chromium (-disable-gpu-compositing) that I can use here?
I’m not an expert, but I see good FPS results (greater than 60, for me, but the target depends on the application), except some items:
...
[terrain] <default>: FPS: 17 FrameTime: 61.359 ms
...
[refract] <default>: FPS: 44 FrameTime: 22.810 ms
Maybe these benchmarks use some specific GPU features.
What I learned in the past few months is that some of these features were buggy in NXP drivers (latest release of linux-imx should clontain the fixes - this is what NXP tech support told me).
But the problem is that NXP follows every release of Yocto (no matter if LTS or not-LTS), and so you should update Yocto too.
Maybe your Yocto build is nanbield or scarthgap and so it includes newer NXP linux-imx?
Torizon OS follows Yocto LTS only (I agree with this) and so Torizon OS 6 it’s kirkstone. For this reason it’s stuck on an old linux-imx (the latest release by NXP for kirkstone).
If you’re curious you can try the following benchmarks https://webglsamples.org/ with Yocto and Torizon OS. I would expect more or less the same FPS for some of them, and better Yocto performance for other (fishtank, lots-o-images).
Can you confirm this?