IMPORTANT:
I made a pretty silly decision and bountied this before a build finished in which I had made a change that solved my main issue of just getting things to work, was pretty beat down by this issue and expected it not to work. I will update this question to explain what I did to get it working, but in the interest of not wasting 100 rep, I would like to award that to anyone who can give me a bit more information/background on how I could have troubleshot this faster and less painfully
I am trying to adapt this Xilinx design tutorial (which is intended for the Xilinx devboard for Zynq US+) to the avnet ultrazed EV SOM and carrier card (a very similar system) using petalinux/vitis/vivado 2022.2. To do this, I started from the first tutorial and built the required outputs using the BSP and board definition for my board, as well as a custom command when building petalinux (-c avnet-image-full
). All previous tutorials have run (mostly) fine, but this one is giving me trouble.
I am at the final steps of the demo, and Im encountering the following issues:
First issue
In this step:
"Set the display parameters and start Xorg with the correct depth."
# export DISPLAY=:0.0 # /usr/bin/Xorg -depth 16&
I encounter an error when trying to run Xorg:
Fatal server error:
(EE) Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
If I grep running processes for it, I can see that Xorg is indeed already running. I did try killing it but it automatically restarts:
root@uz7ev:~# ps -ax | grep Xorg
889 ? Ss 0:00 xinit /etc/X11/Xsession -- /usr/bin/Xorg :0 -br -pn
891 tty3 S<sl+ 0:00 /usr/bin/Xorg :0 -br -pn
954 ttyPS0 S+ 0:00 grep Xorg
root@uz7ev:~# kill -9 891
root@uz7ev:~# ps -ax | grep Xorg
955 ? Ss 0:00 xinit /etc/X11/Xsession -- /usr/bin/Xorg :0 -br -pn
957 tty2 D<s+ 0:00 /usr/bin/Xorg :0 -br -pn
959 ttyPS0 S+ 0:00 grep Xorg
To me this seems like it is functioning correctly and basically just doing that step for me. I did notice there is no depth option but from what I can see in the xorg.conf:
Section "Screen"
Identifier "DefaultScreen"
Device "ZynqMP"
DefaultDepth 16
SubSection "Display"
Modes "1920x1080"
EndSubSection
EndSection
That seems to be the default? Please correct me if I am misunderstanding, I have very little knowledge on X11/X stuff and that is not my goal in completing this tutorial. With that said, I tried to just move on with the tutorial...
Second issue
Continuing with the tutorial, I try to run the example and everything looks ok:
root@uz7ev:~# tricube
Start Main
Calling OpenDisplay
Calling XCreateSimpleWindow
Calling XStoreName
Calling XMapWindow
Calling prepareGraphics
Calling eglGetDisplay
Display Used 0x1 & EGL versions are 1.4
Your EGL Version is "1.4 Linux-r9p0-01rel0"
Your EGL Vendor is "ARM"
Calling doGraphics
iLocPosition = 0
iLocColor = 1
iLocMVP = 0
But I get no output on my monitor, and it goes to sleep. To be clear, the connection is detected, as I get a different 'No input: check cable' on my monitor when it is unplugged vs just black screen and goes to sleep when plugged in. I try running xrandr and see that my monitor is connected and detected correctly:
Ill edit it in here later, closed my terminal and lost the output, and currently have no monitor to recheck.
Imagine some correct looking (contains all reasonable resolutions and framerates) xrandr results, with 1920 x 1080 60 having a star, presumably showing it is the selected mode)
I next try to examine the Xorg logs and see that there is an error present:
[ 240.474] (EE) Failed to load module "glx" (module does not exist, 0)
So after looking through rootfs package-config menu, I enabled the following: xserver-xorg-extension-glx
as well as the base xserver-xorg
(assuming you need the base to enable the extension). This seemed to yield progress, and leads to
Third (current) issue
A short disclaimer first, I have tried other things. Mostly haphazardly enabling packages that seem like they are related to X11/Mali GPU. This may have put me in a state where some things are conflicting, but I believe I have mostly cleaned up after trying each thing. I am very unsure at this point if I am missing packages, have the wrong ones, or have too many/conflicting ones. I am hoping someone has adapted this example to this board or similar, or is familiar enough with the packages in play to be able to suggest what I could be doing wrong or if I am on the right path.
On to the issue; Now when I check the Xorg logs, I see a new error:
[ 41.426] (EE) AIGLX error: dlopen of /usr/lib/dri/armsoc_dri.so failed (/usr/lib/dri/armsoc_dri.so: cannot open shared object file: No such file or directory)
[ 41.426] (EE) AIGLX error: unable to load driver armsoc
Similar to before, I tried searching the rootfs config options and enabled the few armsoc
related drivers I saw, but nothing I did was able to resolve the issue or get me past that error. If I search the whole filesystem, I do see that I have a /usr/lib/xorg/modules/drivers/armsoc_drv.so
present, but Im pretty confused by the differences or what I should be using. I also see the following during boot, its one of the only failed operations and seems like it might be related to shared objects/libs?
[FAILED] Failed to start Rebuild Dynamic Linker Cache.
I'm hoping from all that, someone can provide direction or another place to look. Currently, I plan on going through the tutorials as if I had the correct board, and then compare the enabled packages/drivers to what Im getting from running with -c avnet-image-full
. Happy to answer any questions about this system if someone with driver/linux config knowledge comes along that isnt familiar with petalinux/Zynq chips. Also happy to retag if appropriate, did my best to choose relevant ones.
The Solution
Disclaimer that this is what worked for me. There are likely some unnecessary steps and unideal configuration. I intend to clean things up as I go but my main goal in the immediate was to be able to test/use the GPU. This is just to help anyone with a similar goal. So using the Avnet supplied BSP and board description files:
- Followed all prereq tutorials to create XSA and petalinux project, making sure to build petalinux project with
-c avnet-image-full
to prevent error when building - Ammended
project-spec/meta-avnet/recipies-bsp/device-tree/files/uz7ev-evcc/system-bsp.dtsi
to remove&axi_intc_0
and&amba_pl
labels and add the following to&sdhci1
to prevent kernel panic on boot:
max-frequency = <19000000>;
sdhci-caps-mask = <0 0x200000>;
sdhci-caps = <0 0>;
disable-wp;
broken-cd;
- While following the first design tutorial (GPIO/LED), an interrupt had to be added to the PS block to get it to match. Not sure if this was necessary
- Built the entire line of tutorials for the correct board (unable to test) and copied over the rootfs config to my avnet board project. Also not sure if this did anything.
- In the tutorial step to reconfigure the hardware with vivado, DO NOT follow the step to configure Displayport to dual lower. I believe following this step was the main issue causing the problems outlined in this question as after switching it back, I was able to get a displayport output
Still a bit of work to do to get the tricube example working, as I currently have a 'desktop' like environment that came with the avnet install. Will update if there are any more major changes required to get that working but I believe I will just need to replace the code running the desktop with the tricube example, hoping that will not be too difficult