libGL error: failed to load driver: swrast

Hi There,

I am trying to run sample from GitHub - dusty-nv/jetson-inference: Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson., and encounter below error, any comments to help? Thanks.

jetson-inference/build/aarch64/bin$ ./detectnet csi://0
[gstreamer] initialized gstreamer, version
[gstreamer] gstCamera – attempting to create device csi://0
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera successfully created device csi://0
[video] created gstCamera from csi://0

gstCamera video options:

– URI: csi://0
- protocol: csi
- location: 0
– deviceType: csi
– ioType: input
– codec: raw
– width: 1280
– height: 720
– frameRate: 30.000000
– bitRate: 0
– numBuffers: 4
– zeroCopy: true
– flipMethod: rotate-180
– loop: 0
– rtspLatency 2000

[OpenGL] glDisplay – X screen 0 resolution: 1920x1080
[OpenGL] glDisplay – X window resolution: 1920x1080
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


Could you run the following command and try it again?

$ export DISPLAY=:0


Thanks for the feedback, then I will not able to display result in the OpenGL window… Can I fix it and make the display?

Note that having a “DISPLAY” environment variable set is mandatory for all GUI displays. Not having exported the “DISPLAY” is what would cause a failure. Or if the “DISPLAY” is incorrect, e.g., if you use “DISPLAY=:0.0” when it is really “DISPLAY=:1.0”.

The system does create logs for each DISPLAY. Note that if you look at “ls /var/log/Xorg.*.log”, then the “*” will likely be “0”, but it could be “1” or “10” or something else. Tradition is to use “0”, but it might sometimes enumerate as “1” (especially if you have two monitors), or even something quite different for a virtual display, e.g., “10”. Posting the “/var/log/Xorg.0.log” is likely useful.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.