JetPack 4.3: MESA-LOADER: failed to open swrast while in xrdp session

Hi there,

after initially struggeling to get the combination of xrdp and gnome to work on the Jetson Nano (I eventually gave up and switched to the Mate desktop. BTW that problems seems to be also swras_dri related), I am now trying to solve the next problem, again it seems to be related to the swrast driver / libgl environent on the Nano.

If I try to run glxinfo in a Mate terminal window while being in a xrdp session, I am getting the following error message(s):

$ glxinfo
name of display: :10.0
MESA-LOADER: failed to open swrast (search paths /usr/lib/aarch64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 53
Current serial number in output stream: 52

I already googled around, I even installed the latest MESA libraries and tools. Played around with LD_LIBRARY_PATH settings etc.
I also double checked the links to the key libraries. The swrast_dri.so file seems to be also in the correct location:

/usr/lib/aarch64-linux-gnu/dri/swrast_dri.so

I even created an additional link into /usr/lib/dri, but no change.

That problem doesn’t show if I connect my Nano to a real monitor.

Any ideas? ;)

Thanks in advance, Alexander

1 Like

Is the error always same as “failed to open swrast (search paths /usr/lib/aarch64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)” even after you create link or include the path?

If I remember correcty, yes.

Unfortunately I cannot try to reproduce it again at the moment, since I started with a fresh JetPack 4.3 image last night in order to rule out any potential side effects of installing any other packages.

I will try to install xrdp again later today just to see if there is any difference.

As mentioned above, I came across that problem while initially trying to make xrdp work in combination with gnome.

Each time I tried to connect to my headless Nano using Microsoft Remote Desktop 10 (on MacOS) I briefly (<= 1 sec) saw a black window with the Nvidia logo which eventually disappeared. While repeating that connect test, I run a tail -f /var/log/syslog. In the syslog file I noticed the following entries:

Jan 30 10:47:27 demo-nvidia at-spi-bus-launcher[7186]: dbus-daemon[7191]: Activating service name=‘org.a11y.atspi.Registry’ requested by ‘:1.0’ (uid=1000 pid=7184 comm=“/usr/lib/gnome-session/gnome-session-check-acceler”)
Jan 30 10:47:27 demo-nvidia at-spi-bus-launcher[7186]: dbus-daemon[7191]: Successfully activated service ‘org.a11y.atspi.Registry’
Jan 30 10:47:27 demo-nvidia at-spi-bus-launcher[7186]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Jan 30 10:47:28 demo-nvidia gnome-session[7005]: MESA-LOADER: failed to open swrast (search paths /usr/lib/aarch64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)
Jan 30 10:47:28 demo-nvidia gnome-session[7005]: libGL error: failed to load driver: swrast
Jan 30 10:47:28 demo-nvidia gnome-session[7005]: gnome-session-binary[7005]: WARNING: software acceleration check failed: Child process exited with code 1
Jan 30 10:47:28 demo-nvidia gnome-session-binary[7005]: WARNING: software acceleration check failed: Child process exited with code 1
Jan 30 10:47:28 demo-nvidia gnome-session[7005]: gnome-session-binary[7005]: CRITICAL: We failed, but the fail whale is dead. Sorry


The MESA-LOADER error seems to point into the same direction like the problem which I mentioned in my first post.

Thx in advance for your support!

Quick update: I just did the following steps on my fresh JetPack 4.3 install:

  1. I added the following key to the file ‘/usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml’
Enable remote access to the desktop If true, allows remote access to the desktop via the RFB protocol. Users on remote machines may then connect to the desktop using a VNC viewer. true
  1. I run ‘sudo glib-compile-schemas /usr/share/glib-2.0/schemas’

  2. I then installed xrdp via ‘sudo apt install xrdp’

  3. ‘sudo reboot’

  4. I am now trying to connect again to my Nano via MS Remote Desktop 10 and I am getting the same error as yesterday (see my post #3).

  • Alexander

Ciao,

I have the same problem of AlexKoeMuc.
I’m trying to connect to my Jetson TX via Microsoft Remote Desktop (Windows 10)
and xrdp, but and I am getting the same error (see syslog messages below) and seeing a black window with the Nvidia logo which disappears.

Feb 1 16:59:22 jetsontx2 gnome-session[7900]: MESA-LOADER: failed to open swrast (search paths /usr/lib/aarch64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)
Feb 1 16:59:22 jetsontx2 gnome-session[7900]: libGL error: failed to load driver: swrast
Feb 1 16:59:22 jetsontx2 gnome-session[7900]: gnome-session-binary[7900]: WARNING: software acceleration check failed: Child process exited with code 1
Feb 1 16:59:22 jetsontx2 gnome-session[7900]: gnome-session-binary[7900]: CRITICAL: We failed, but the fail whale is dead. Sorry


In a previous setup of the Jetson (about three weeks ago always with JetPAck4.3) I was able to connect but now in the same situation (fresh new setup and the same setting of xrdp) it isn’t more possible.
I’m not sure if actual xrdp version is the same of the first succesful setup.

Thx in advance for your support!
Stefano

That problem doesn’t show if I connect my Nano to a real monitor.

I just wonder if giving a fake screen in xorg would help it or not.

Something similar to this:

Hi Wayne,

I haven’t tried a software fake screen yet, but I do have a dummy HDMI plug plugged in now. That dummy plug helps with my VNC setup, but doesn’t seem to help with the XRDP session.

As soon as I will have a few minutes I will try a dummy software monitor/screen as well.

  • Alexander

Hi there,

I started again with a fresh JetPack 4.3 image on my Jetson TX2.

Immediately after I installed xrdp WITHOUT updating the operating system and I can connect
now to my headless Jetson TX2 using Microsoft Remote Desktop on Windows 10.

I have tried with an attached monitor but also without it and the XRDP session works well.

Now I will try to update the operating system to see what happens.

  • Stefano

Quick update: unfortunately I have verified that after updating the operating system (260 packages!) remote access no longer works!

The following packages have been updated:

apport apport-gtk apt aptdaemon aptdaemon-data aspell base-files bind9-host bluez bluez-obexd bsdutils chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra cpio distro-info-data dmsetup dpkg dpkg-dev e2fsprogs fdisk file file-roller fonts-opensymbol gdb gdbserver ghostscript ghostscript-x gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-4.0 gir1.2-mutter-2 gir1.2-nm-1.0 gir1.2-nma-1.0 gir1.2-snapd-1 gir1.2-soup-2.4 gir1.2-webkit2-4.0 git git-man gnome-calculator gnome-control-center gnome-control-center-data gnome-control-center-faces gnome-shell gnome-shell-common gnome-software gnome-software-common gnome-software-plugin-snap grep grub-common ibus ibus-gtk ibus-gtk3 imagemagick imagemagick-6-common imagemagick-6.q16 initramfs-tools initramfs-tools-bin initramfs-tools-core kde-window-manager kwin-common kwin-data kwin-x11 libapt-inst2.0 libapt-pkg5.0 libarchive13 libaspell15 libbind9-160 libblkid1 libbluetooth3 libbsd0 libcom-err2
libdevmapper1.02.1 libdjvulibre-text libdjvulibre21 libdns-export1100 libdns1100 libdpkg-perl libdrm-amdgpu1 libdrm-common libdrm-dev libdrm-etnaviv1 libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libdrm-tegra0 libdrm2 libegl-mesa0 libegl1-mesa libexiv2-14 libext2fs2 libfdisk1 libgbm1 libgcrypt20 libgl1-mesa-glx libglapi-mesa libglx-mesa0 libgnutls30 libgs9 libgs9-common libibus-1.0-5 libidn2-0 libirs-export160 libisc-export169 libisc169 libisccc160 libisccfg-export160 libisccfg160 libjavascriptcoregtk-4.0-18 libjpeg-turbo8
libkwin4-effect-builtins1 libkwineffects11 libkwinglutils11 libkwinxrenderutils11 libllvm8 liblwres160 libmagic-mgc libmagic1 libmagickcore-6.q16-3 libmagickcore-6.q16-3-extra libmagickwand-6.q16-3 libmount1 libmutter-2-0 libmysqlclient20 libnautilus-extension1a libnm-glib4 libnm-gtk0 libnm-util2 libnm0 libnma0 libnss-myhostname libnss-systemd libnss3 libopenexr22 libpam-systemd libpcap0.8
libpulse-mainloop-glib0 libpulse0 libpulsedsp libpython3.6 libpython3.6-minimal libpython3.6-stdlib libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5sql5 libqt5test5 libqt5widgets5 libqt5xml5 librados2 librbd1 librdmacm1 libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer libsane-common libsane1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsdl-image1.2 libsdl1.2debian libsgutils2-2 libsmartcols1 libsmbclient libsnapd-glib1 libsnmp-base libsnmp30 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libss2 libssh-4 libssh-gcrypt-4 libssl1.1 libsystemd0 libtiff5 libudev1 libuuid1 libvlc5 libvlccore9 libvpx5 libwayland-egl1-mesa libwbclient0 libwebkit2gtk-4.0-37 libwhoopsie0 libxkbcommon-x11-0 libxkbcommon0 libxslt1.1 linux-firmware linux-libc-dev mount mutter mutter-common nautilus nautilus-data network-manager network-manager-config-connectivity-ubuntu network-manager-gnome openssl pulseaudio pulseaudio-utils python-apt-common python3-apport python3-apt python3-aptdaemon python3-aptdaemon.gtk3widgets python3-distupgrade
python3-distutils python3-lib2to3 python3-problem-report python3-software-properties python3-uno python3.6 python3.6-minimal qt5-gtk-platformtheme rfkill samba-libs sane-utils snapd software-properties-common software-properties-gtk sudo systemd systemd-sysv thunderbird thunderbird-gnome-support tzdata ubuntu-desktop ubuntu-drivers-common ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-settings ubuntu-software ubuntu-web-launchers udev uno-libs3 ure util-linux uuid-dev vlc-data vlc-plugin-base vlc-plugin-video-output whoopsie wpasupplicant

-Stefano

Hi,

I’m having the same issue - it’s really easy to reconstruct:
rivermax@rivermax-jetson-platform:~$ glxinfo | grep “OpenGL version”
MESA-LOADER: failed to open swrast (search paths /usr/lib/aarch64-linux-gnu/dri:${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast

OpenGL version string: 1.4 (4.5.0 - Build 25.20.100.6472)

I believe that the issue starts once you upgrade libgl1-mesa-dev - 19.2.8-0ubuntu0~18.04.1
on a different setup I’m using version 19.0.8-0ubuntu0~18.04.3 and there is no issue there.

I’m still looking for a good solution for that.

-Nir

Actually I would like to know what is the exact step to hit this issue.

What is installed? only xrdp from apt-get?
Is this error reproduced when no display is connected?

Hi @WayneWWW

We are using the Jetson Xavier - this project is using Mellanox NIC + Rivermax SW to stream in/out very high BW (xGbps) of uncompressed VIDEO content.

We are using the GPU on the Jetson for Color Space Conversion - when running the code on the Jetson using HDMI there is no failure.
The failure is only when using SSH X11.

we are installing a long list of libraries - but I know the exact point which is stopped working since we have an image just before this point. updating the mesa-dev is causing the issue.

I can provide this Jetson image if you would like to debug it.
Also feel free to contact me directly nirni@mellanox.com

Thanks
-Nir

The library released by mesa may be not compatible with tegra graphic.

The failure is only when using SSH X11.
Why ssh? Aren’t we talking about xrdp?

Based on our experience on vnc, you should add a screen section as below in xorg.conf.

----------------------------------------------------------------------
Setting the Desktop Resolution
----------------------------------------------------------------------

The desktop resolution is typically determined by the capabilities of the
display that is attached to Jetson. If no display is attached, a default
resolution of 640x480 is selected. To use a different resolution, edit
/etc/X11/xorg.conf and append the following lines:

Section "Screen"
   Identifier    "Default Screen"
   Monitor       "Configured Monitor"
   Device        "Tegra0"
   SubSection "Display"
       Depth    24
       Virtual 1280 800 # Modify the resolution by editing these values
   EndSubSection
EndSection

Thank you for the suggestion - I’m not sure it’s related to the issue in hand.

I’m connected to the Jetson using SSH - I don’t need to display anything.
I’m getting an error just by running this: rivermax@rivermax-jetson-platform:~$ glxinfo | grep “OpenGL version”

I will be happy to have a online session to demonstrate the issue.

Thanks
-Nir

Hi Nir,

Ok then I guess your usecase is different with other users in this post.

Anyway, please try to add the setting in xorg.conf and see if it helps.

Actually, I think it is an issue in mesa driver and need to check how they implement this part.

Also, according to the src of glxinfo, I see it run XCreateWindow", it means this application is based on X.
https://cgit.freedesktop.org/mesa/demos/tree/src/xdemos/glxinfo.c

Thus, when running glxinfo, you need to do something as “export DISPLAY=:0”

According to the previous comment, I saw glxinfo would return “name of display: :10.0”. This sounds a remote display number and does not related to any nvidia display. That could be the reason that when you have no display connected, it is dead.

Hi @WayneWWW,

What is installed? only xrdp from apt-get?
Yes.
Is this error reproduced when no display is connected?
Yes but if it is connected too.

I investigated further and the problem occurs to me only when I update
the following libraries (the Installed version is the original one)

libdrm-freedreno1: Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-nouveau2:   Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-etnaviv1:   Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-amdgpu1:    Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-tegra0:     Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-radeon1:    Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-dev:        Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm-common:     Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1
libdrm2:           Installed: 2.4.97-1ubuntu1~18.04.1 -> Candidate: 2.4.99-1ubuntu1~18.04.1

Thx for your support!

  • Stefano

Yes but if it is connected too.

Do you mean error happens even when monitor is connected?

I investigated further and the problem occurs to me only when I update
the following libraries (the Installed version is the original one)

Why do you need to update these drm libararies? Could you share what is your current purpose?
Actually, the drm running on tegra is libdrm_nvdc.so. Please make sure libdrm.so links to this file or your might hit error.

Hy WayneWWW,

Do you mean error happens even when monitor is connected?
Yes, the error also occurs when a monitor is connected via HDMI, obviously only remote accessing the Jetson Nano via xRDP protocol. Local access (not headless) has no problems whatsoever.

Please make sure libdrm.so links to this file or your might hit error.
I have verified that after updating the libraries (and so when the problem happens again) the file libdrm.so correctly links.

From now on I will update the system if I need it without ever updating the following libraries using the command:

apt mark hold libdrm-amdgpu1 libdrm-common libdrm-dev libdrm-etnaviv1 libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libdrm-tegra0 libdrm2

Regarding the use of the Jetson boards (we have to use several of them) I should use a java application (jdk 8u112 based) that uses the jfx library but I didn’t find any useful information except that probably I have to use openjdk and openjfx. Could you give me some links about a complete working package?

Thx in advance

  • Stefano

Hi Stefano,

I think you should file separate topics for openjdk. We should focus on the original error here.

@sorlando - Thank you for posting - putting these application on hold is also working for me (at least to avoid the mesa loader issue). I’m pretty sure it’s related to the libdrm2 application but don’t have anytime to tests.