From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 107309] libGL error: MESA-LOADER: failed to retrieve device information on virgl Date: Fri, 20 Jul 2018 13:28:52 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1459002834==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id E41FC6EFC4 for ; Fri, 20 Jul 2018 13:28:51 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1459002834== Content-Type: multipart/alternative; boundary="15320933310.FeFF38.882" Content-Transfer-Encoding: 7bit --15320933310.FeFF38.882 Date: Fri, 20 Jul 2018 13:28:51 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D107309 Bug ID: 107309 Summary: libGL error: MESA-LOADER: failed to retrieve device information on virgl Product: DRI Version: XOrg git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: libdrm Assignee: dri-devel@lists.freedesktop.org Reporter: vliaskovitis@suse.com Created attachment 140732 --> https://bugs.freedesktop.org/attachment.cgi?id=3D140732&action=3Dedit xf86drm: Correctly parse pci device information for virtio gpu Mesa 18.1.3-201.1 kernel 4.17.5-1-default libdrm 2.4.92-1.2 glxinfo | grep -i renderer OpenGL renderer string: virgl LIBGL_DEBUG=3Dverbose glxgears libGL error: MESA-LOADER: failed to retrieve device information libGL: using driver virtio_gpu for 4 libGL: OpenDriver: trying /usr/lib64/dri/tls/virtio_gpu_dri.so libGL: OpenDriver: trying /usr/lib64/dri/virtio_gpu_dri.so Adding some debug drmMsg() prints, I found that the MESA-LOADER error messa= ge happens because drmGetDevice2() returns -ENODEV. And that happens because drmParseSubsystemType() returns -EINVAL. drmParseSubsystemType() expects /sys/dev/char/DRM_MAJOR\:0/device/subsystem= to be one of pci, usb, platform, hostix. But virtio-gpu has bus subsystem virt= io: ls -al /sys/dev/char/226\:0/device/subsystem lrwxrwxrwx 1 root root 0 Jul 19 17:39 /sys/dev/char/226:0/device/subsystem = -> ../../../../bus/virtio ls -al /sys/dev/char/226\:128/device/subsystem lrwxrwxrwx 1 root root 0 Jul 19 17:39 /sys/dev/char/226:128/device/subsyste= m -> ../../../../bus/virtio I am not sure if this is a cosmetic error, or if it matters. I am attaching= a proposed patch. Since the virtio-gpu device is actually a pci device, we can still parse the correct information from the corresponding pci device: ls -al /sys/dev/char/226\:0 lrwxrwxrwx 1 root root 0 Jul 20 13:30 /sys/dev/char/226:0 -> ../../devices/pci0000:00/0000:00:02.0/virtio0/drm/card0 i.e. use /sys/dev/char/226\:128/../../../ instead of /sys/dev/char/226\:128/ for virtio devices. to parse subsystem, and subsequently pci bus and pci device information. (Let me know if bugzilla is still the place to report bugs, or if=20 https://gitlab.freedesktop.org/mesa/drm is now the preferred location) --=20 You are receiving this mail because: You are the assignee for the bug.= --15320933310.FeFF38.882 Date: Fri, 20 Jul 2018 13:28:51 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 107309
Summary libGL error: MESA-LOADER: failed to retrieve device informati= on on virgl
Product DRI
Version XOrg git
Hardware Other
OS All
Status NEW
Severity normal
Priority medium
Component libdrm
Assignee dri-devel@lists.freedesktop.org
Reporter vliaskovitis@suse.com

Created attachment 140732 [details] [review]
xf86drm: Correctly parse pci device information for virtio gpu

Mesa 18.1.3-201.1
kernel 4.17.5-1-default
libdrm 2.4.92-1.2

glxinfo | grep -i renderer
OpenGL renderer string: virgl

LIBGL_DEBUG=3Dverbose glxgears
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver virtio_gpu for 4
libGL: OpenDriver: trying /usr/lib64/dri/tls/virtio_gpu_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/virtio_gpu_dri.so

Adding some debug drmMsg() prints, I found that the MESA-LOADER error messa=
ge
happens because drmGetDevice2() returns -ENODEV. And that happens because
drmParseSubsystemType() returns -EINVAL.

drmParseSubsystemType() expects /sys/dev/char/DRM_MAJOR\:0/device/subsystem=
 to
be one of pci, usb, platform, hostix. But virtio-gpu has bus subsystem virt=
io:

ls -al /sys/dev/char/226\:0/device/subsystem
lrwxrwxrwx 1 root root 0 Jul 19 17:39 /sys/dev/char/226:0/device/subsystem =
->
../../../../bus/virtio

ls -al /sys/dev/char/226\:128/device/subsystem
lrwxrwxrwx 1 root root 0 Jul 19 17:39 /sys/dev/char/226:128/device/subsyste=
m ->
../../../../bus/virtio

I am not sure if this is a cosmetic error, or if it matters. I am attaching=
 a
proposed patch.

Since the virtio-gpu device is actually a pci device, we can still parse the
correct information from the corresponding pci device:

ls -al /sys/dev/char/226\:0
lrwxrwxrwx 1 root root 0 Jul 20 13:30 /sys/dev/char/226:0 ->
../../devices/pci0000:00/0000:00:02.0/virtio0/drm/card0

i.e. use /sys/dev/char/226\:128/../../../ instead of /sys/dev/char/226\:128/
for virtio devices.

to parse subsystem, and subsequently pci bus and pci device information.

(Let me know if bugzilla is still the place to report bugs, or if=20
https://gitlab.freedesk=
top.org/mesa/drm is now the preferred location)


You are receiving this mail because:
  • You are the assignee for the bug.
= --15320933310.FeFF38.882-- --===============1459002834== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1459002834==--