pierlon / scrcpy-docker

Easily run scrcpy with Docker
MIT License
138 stars 32 forks source link

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

Open jvandenbroek opened 6 years ago

jvandenbroek commented 6 years ago

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 commented 6 years ago

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

jvandenbroek commented 6 years ago

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

pierlon commented 6 years ago

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

jvandenbroek commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago
% 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 commented 5 years ago

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

waahhhh commented 5 years ago

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 commented 1 year ago

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 commented 1 year ago

Already fixed in a "newer" pull request. Still waiting for merge. See: https://github.com/pierlon/scrcpy-docker/pull/25