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

Jump into this thread.

For this “failed to open swrast” issue, could you try to link the libdrm.so.2 to libdrm.so.2.4.0?

/usr/lib/aarch64-linux-gnu/libdrm.so.2 → /usr/lib/aarch64-linux-gnu/libdrm.so.2.4.0.

3 Likes

@WayneWWW

I am experiencing the same problem and tried updating the symlink:

cd /usr/lib/aarch64-linux-gnu 
sudo ln -sf libdrm.so.2 libdrm.so.2.4.0

I then rebooted but still when I login using xrdp the nvidia logo shows for less than a second and the session is disconnected.

I installed jetpack 441:
jetson-nano-4gb-jp441-sd-card-image.zip
From https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write

Is this the right image? I’ve updated Ubuntu to the latest packages.

I’d really like to use the Nano Headless if at all possible.

Thanks,
Al

@al17

The symlink command you pasted is wrong. Using your command will link the libdrm.so.2.4.0 → libdrm.so.2…

SOLVED!!!

Hi Wayne, you are perfectly right, the ln command expects target and link and not vice versa, so @al17’s command will not work.

I have updated the symlink as you suggest and I have now
libdrm.so.2 → libdrm.so.2.4.0

After reboot, the MESA issue failed to load swrast is fully solved. I can run glxgears but also other OpenGL programs that previously failed.

My use case is the same as many people in this thread - I am running Jetson Nano headless and log into it using xrdp.
Had login issues with gnome, resolved first by installing XFCE4, probably after your fix gnome would work as well, but I am quite ok with xfce and will not be changing it in the nearest future.

Thank you for the symlink suggestion!

1 Like

Creating the link libdrm.so.2 → libdrm.so.2.4.0 solves the problem temporarily until the next time ldconfig runs (which will be triggered by e.g. an apt-get install).

The problem seems to be that the link libdrm_nvdc.so → tegra/libdrm.so.2 will cause ldconfig to overwrite libdrm.so.2 with link to libdrm_nvdc.so.

To solve this permanently, I removed the link libdrm_nvdc.so → tegra/libdrm.so.2, and then ran ldconfig:

sudo rm /usr/lib/aarch64-linux-gnu/libdrm_nvdc.so
sudo ldconfig

This created the link libdrm.so.2 → libdrm.so.2.4.0.

Of course this could potentially result in other kinds of failures, but I have not experienced any yet.

2 Likes

I had the same problem. And it’s solved with @qwertypanda 's post. My work settings are:

  1. target: NX production module on CTI Quark board, headless, JetPack 4.5, L4T 32.5.
  2. host PC: laptop with Linux 18.04.
  3. Since the target is headless, I installed NoMachine to open the desktop of the NX. Xfce4 is installed on NX as a desktop.

When I run Cuda sample oceanFFT, I hit the libGL error, fixed with re-link the libdrm.so as said above.
Now I encounter a new error as following:

$ ./oceanFFT
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

[CUDA FFT Ocean Simulation]

Left mouse button - rotate
Middle mouse button - pan
Right mouse button - zoom
‘w’ key - toggle wireframe
[CUDA FFT Ocean Simulation]
GPU Device 0: “Xavier” with compute capability 7.2

CUDA error at oceanFFT.cpp:296 code=999(cudaErrorUnknown) “cudaGraphicsGLRegisterBuffer(&cuda_heightVB_resource, heightVertexBuffer, cudaGraphicsMapFlagsWriteDiscard)”
corrupted size vs. prev_size
Aborted (core dumped)

A graphic window opened and closed briefly.
In this case, is this a side effect of re-link the libdrm.so or something else with remote desktop? If anyone has the solution, please help.

Thanks.

Hi stuart-xu -

Have you contacted our Tech Team? If you fill out our Support Form, your team will help you troubleshoot and get you up and running.

Let me know if you have any questions!
Jacki

Hi WayneWWW, Just re-installed Jetson Nano Developer Kit SD Card Image 4.5.1 2021/02/24 from the scratch and faced the same issue - “libGL error: MESA-LOADER: failed to open swrast”. To reproduce the issue:

sudo apt install xvfb mesa-utils
Xvfb :99 -screen 0 1600x1200x24 &
export DISPLAY=:99
glxinfo
name of display: :99
libGL error: 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
...

Is there any workaround? When the issue will be fixed completely? Thanks!

Scroll back few comments and you will see it.

Already tried - this won’t fix the issue.

What did you try? Is the symlink the one you want now?

I’ve tried again and it works! Thanks! What libdrm_nvdc.so is used for? sudo rm -f /usr/lib/aarch64-linux-gnu/libdrm_nvdc.so also fix the issue, but probably produce some other issues…

hey there. I also facing the same problem when i launch some file to run the jetson-inference commands on jetbot gui using nvidia jetson nano 2gb DK and here is the error:
libGL error: 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: 39
Current serial number in output stream: 38

and any one help me I need to figure out

Do you get the same error with other OpenGL applications like glxgears?

Have you tried this suggestion from above?

Thank You the previous error is gone. but the new one is come to my face it says:

[cuda]      invalid OpenGL or DirectX context (error 219) (hex 0xDB)
[cuda]      /home/jetbot/jetson-inference/utils/display/glTexture.cpp:360
[cuda]      invalid OpenGL or DirectX context (error 219) (hex 0xDB)
[cuda]      /home/jetbot/jetson-inference/utils/cuda/cudaYUV-NV12.cu:154
[cuda]      invalid OpenGL or DirectX context (error 219) (hex 0xDB)
[cuda]      /home/jetbot/jetson-inference/utils/cuda/cudaColorspace.cpp:48
[cuda]      invalid OpenGL or DirectX context (error 219) (hex 0xDB)
[cuda]      /home/jetbot/jetson-inference/utils/camera/gstCamera.cpp:728
[gstreamer] gstCamera::Capture() -- unsupported image format (rgba32f)
[gstreamer]                         supported formats are:
[gstreamer]                             * rgb8
[gstreamer]                             * rgba8
[gstreamer]                             * rgb32f
[gstreamer]                             * rgba32f

It seems your OpenGL is still wonky - in the past, others have been able to fix it by installing nvgld again:

Baring that, you may want to reflash SD card to restore OpenGL drivers to their expected setup.