From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 103575] eglQueryDevicesEXT returns 0 devices Date: Sun, 05 Nov 2017 01:48:32 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2135305975==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F8D86E0D7 for ; Sun, 5 Nov 2017 01:48:32 +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 --===============2135305975== Content-Type: multipart/alternative; boundary="15098465120.6b47eb1eB.21721"; charset="UTF-8" --15098465120.6b47eb1eB.21721 Date: Sun, 5 Nov 2017 01:48:32 +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=3D103575 Bug ID: 103575 Summary: eglQueryDevicesEXT returns 0 devices Product: Mesa Version: 17.2 Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 Assignee: dri-devel@lists.freedesktop.org Reporter: Hi-Angel@yandex.ru QA Contact: dri-devel@lists.freedesktop.org I'm following this guide https://devblogs.nvidia.com/parallelforall/egl-eye-opengl-visualization-wit= hout-x-server/ to choose a GPU through native means of EGL. Using eglQueryDevicesEXT() in both modes, i.e. with "devices" array to get descriptions, as well as by passing 0 as "devices", results in 0 as a numbe= r of supported devices. Specification says that I should've get at least 1 (and I actually have two, r600g-managed, cards): https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_device_enumerat= ion.txt > EGL devices can be enumerated before EGL is initialized. Use: >=20 > EGLBoolean eglQueryDevicesEXT(EGLint max_devices, > EGLDeviceEXT *devices, > EGLint *num_devices); [SNIP] > If is NULL, then will be ignored, no devices will= be > returned in , and will be set to the number of > supported devices in the system. All implementations must support at lea= st > one device. >=20 > On failure, EGL_FALSE is returned. Below is the modified code I'm using: #include #include #include int main(int argc, char *argv[]) { EGLint numDevices; PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT =3D (PFNEGLQUERYDEVICESEXTPROC) eglGetProcAddress("eglQueryDevicesEXT"); if (eglQueryDevicesEXT(2, 0, &numDevices) =3D=3D EGL_FALSE) { puts("error in eglQueryDevicesEXT"); return 1; } printf("Detected %d devices\n", numDevices); } --=20 You are receiving this mail because: You are the assignee for the bug.= --15098465120.6b47eb1eB.21721 Date: Sun, 5 Nov 2017 01:48:32 +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 103575
Summary eglQueryDevicesEXT returns 0 devices
Product Mesa
Version 17.2
Hardware x86-64 (AMD64)
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component Drivers/Gallium/r600
Assignee dri-devel@lists.freedesktop.org
Reporter Hi-Angel@yandex.ru
QA Contact dri-devel@lists.freedesktop.org

I'm following this guide
https://devblogs.nvidia.com/parallelforall/egl-e=
ye-opengl-visualization-without-x-server/
to choose a GPU through native means of EGL.

Using eglQueryDevicesEXT() in both modes, i.e. with "devices" arr=
ay to get
descriptions, as well as by passing 0 as "devices", results in 0 =
as a number of
supported devices. Specification says that I should've get at least 1 (and I
actually have two, r600g-managed, cards):

https://www.khronos.org/registry/EGL/extensions/EXT/EGL=
_EXT_device_enumeration.txt
> EGL devices can be enumerated before EGL is init=
ialized.  Use:
>=20
>         EGLBoolean eglQueryDevicesEXT(EGLint max_devices,
>                                       EGLDeviceEXT *devices,
>                                       EGLint *num_devices);
[SNIP]
> If <devices> is NULL, then <max_devices=
> will be ignored, no devices will be
> returned in <devices>, and <num_devices> will be set to th=
e number of
> supported devices in the system.  All implementations must support at =
least
> one device.
>=20
> On failure, EGL_FALSE is returned.

Below is the modified code I'm using:

        #include <EGL/egl.h>
        #include <EGL/eglext.h>
        #include <stdio.h>

        int main(int argc, char *argv[])
        {
            EGLint numDevices;

            PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT =3D
                (PFNEGLQUERYDEVICESEXTPROC)
eglGetProcAddress("eglQueryDevicesEXT");
            if (eglQueryDevicesEXT(2, 0, &numDevices) =3D=3D EGL_FALSE)=
 {
                puts("error in eglQueryDevicesEXT");
                return 1;
            }

            printf("Detected %d devices\n", numDevices);
        }


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