Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libGL error: unable to load driver: swrast_dri.so #2

Open
jvandenbroek opened this issue Mar 31, 2018 · 10 comments
Open

libGL error: unable to load driver: swrast_dri.so #2

jvandenbroek opened this issue Mar 31, 2018 · 10 comments

Comments

@jvandenbroek
Copy link

Tried this docker image on Xubuntu 17.10 amd64, but I get the following error when running scrcpy:

/ # scrcpy 
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 3.6 MB/s (19334 bytes in 0.005s)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
CRITICAL: Could not create renderer: Couldn't find matching render driver
ERROR: Could not open video stream

Some more info:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.5.0 NVIDIA 390.48
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 390.48
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.48
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix, 
@pierlon
Copy link
Owner

pierlon commented Mar 31, 2018

Hey @jvandenbroek, could you try the nvidiaversion of the image?

@jvandenbroek
Copy link
Author

Hi , I actually tried that version.. Not sure why it's not working?

@pierlon
Copy link
Owner

pierlon commented Mar 31, 2018

Try specifying a max size. Eg: scrcpy -m 1024

@jvandenbroek
Copy link
Author

jvandenbroek commented Mar 31, 2018

Tnx, but no change. I think it has to do with that I'm using the official Nvidia driver, not the open source one. Tried to figure out how to install this, but doesn't seem straightforward for Alpine. A well, may try it again later, probably need an image based on Debian or Ubuntu :)

@untoreh
Copy link
Contributor

untoreh commented Jun 25, 2018

for me specifying the max size works, I guess scrcpy doesn't like when the device is running a resolution higher than the one the X server is using.
I also get those errors like

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi

But since it works are these just red herrings?
However if you are getting errors with swrast_dri.so that maybe means you are using software rendering and not actually nvidia drivers on the X server

@d9k
Copy link

d9k commented Oct 26, 2018

% lsb_release -a                      
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
% nvidia-smi    
Fri Oct 26 21:31:22 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130                Driver Version: 384.130                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 710      Off  | 00000000:01:00.0 N/A |                  N/A |
| 33%   64C    P0    N/A /  N/A |    252MiB /   979MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

same error.

I used command

% docker run --rm -i -t --privileged \                                             
    -v /dev/bus/usb:/dev/bus/usb \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$DISPLAY \
    pierlo1/scrcpy:nvidia

to run image

@kenken64
Copy link

having the same error here libGL error: unable to load driver: swrast_dri.so

@waahhhh
Copy link
Contributor

waahhhh commented Jun 30, 2019

I'm using Ubuntu in VirtualBox. The host system has a nvidia GPU.
Got a similar error message:

/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 3.9 MB/s (22470 bytes in 0.006s)
MESA-LOADER: failed to open vmwgfx (search paths /usr/lib/xorg/modules/dri)
libGL error: failed to load driver: vmwgfx
MESA-LOADER: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  86
  Current serial number in output stream:  85

Installing mesa-dri-swrast & mesa-dri-vmwgfx resolved it.

### runner (nvidia)
FROM runner AS nvidia

RUN apk add --no-cache mesa-dri-nouveau mesa-dri-swrast mesa-dri-vmwgfx

@mwoodpatrick
Copy link

FWIW if anyone else hits this issue. I'm running on Alpine Linux v3.17 on latest WSl-2 and was missing

/usr/lib/xorg/modules/dri/swrast_dri.so

Doing

sudo apk add mesa-dri-gallium

fixed my issue prior to installing this I was getting:

glxinfo
name of display: :0
libGL error: MESA-LOADER: failed to open swrast: Error loading shared library /usr/lib/xorg/modules/dri/swrast_dri.so: No such file or directory (search paths /usr/lib/xorg/modules/dri, suffix _dri)
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  148 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  60
  Current serial number in output stream:  61

@waahhhh
Copy link
Contributor

waahhhh commented Dec 5, 2022

Already fixed in a "newer" pull request. Still waiting for merge. See: #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants