Skip to content

Error starting rviz2 from within container - libGL error: MESA-LOADER: failed to retrieve device information #2965

Answered by evshary
tleyden asked this question in Q&A
Discussion options

You must be logged in to vote

I tested on two machines with GPU cards by my side. Both are Ubuntu 20.04 (x86)

  1. Ubuntu 20.04 + GTX 1050
  2. Ubuntu 20.04 + RTX 5000

I met the same issue on GTX 1050 but run successfully on RTX 5000.
I think the problem is that rviz2 does not use NVIDIA GPU but Intel integrated graphics.
You can force to use NVIDIA GPU by the following commands:

prime-select query
# It should show on-demand by default
sudo prime-select nvidia
# Force to use NVIDIA GPU

After reboot, your system will use NVIDIA GPU card by default and rviz2 can run successfully.

Another solution:
If you don't want to use GPU card and want to run with software computation, you can add LIBGL_ALWAYS_SOFTWARE=1.
But it causes bad …

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@tleyden
Comment options

@evshary
Comment options

@tleyden
Comment options

@evshary
Comment options

@tleyden
Comment options

Answer selected by tleyden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants