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

Failure to find hardware adapter #2518

Closed
a1phyr opened this issue Feb 28, 2022 · 6 comments · Fixed by #5307
Closed

Failure to find hardware adapter #2518

a1phyr opened this issue Feb 28, 2022 · 6 comments · Fixed by #5307
Labels
api: gles Issues with GLES or WebGL area: wsi Issues with swapchain management or windowing type: bug Something isn't working

Comments

@a1phyr
Copy link
Contributor

a1phyr commented Feb 28, 2022

Description
On master with OpenGL, wgpu only finds software adapter (llvmpipe) but it works as expected with v0.12

Repro steps
Run wgpu-info, look for the OpenGL adapter

Expected vs observed behavior
Expected behavior: I get a hardware adapter for OpenGL (AMD or NVIDIA if PRIME is enabled) like in wgpu 0.12
Observed behavior: I get a software adapter for OpenGL (llvmpipe)

I also get an error: EGL 'eglInitialize' code 0x3001: DRI2: failed to create screen

Extra materials
Bisecting the issue shows that it comes from 70db03d (#2339)

Failing logs for RUST_LOG=info wgpu-info

[2022-02-28T13:31:40Z WARN  wgpu_hal::vulkan::instance] Unable to find layer: VK_LAYER_KHRONOS_validation
[2022-02-28T13:31:40Z INFO  wgpu_hal::vulkan::instance] Instance version: 0x4030cc
[2022-02-28T13:31:40Z INFO  wgpu_hal::vulkan::instance] Enabling debug utils
[2022-02-28T13:31:40Z INFO  wgpu_hal::vulkan::instance] Enabling device properties2
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Loading Wayland library to get the current display
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Loading X11 library to get the current display
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] No windowing system present. Using surfaceless platform
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Enabling EGL debug output
libEGL warning: DRI2: failed to create dri screen
[2022-02-28T13:31:40Z ERROR wgpu_hal::gles::egl] EGL 'eglInitialize' code 0x3001: DRI2: failed to create screen
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Display vendor "Mesa Project", version (1, 5)
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	EGL surface: +srgb
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	Trying native-render
[2022-02-28T13:31:40Z WARN  wgpu_hal::gles::egl] No config found!
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	Trying presentation
[2022-02-28T13:31:40Z WARN  wgpu_hal::gles::egl] No config found!
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	Trying off-screen
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	EGL context: +debug
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	EGL context: +robust access
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] 	EGL context: +surfaceless
[2022-02-28T13:31:40Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "AMD RADV RENOIR", vendor: 4098, device: 5686, device_type: IntegratedGpu, backend: Vulkan }
[2022-02-28T13:31:40Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce GTX 1650", vendor: 4318, device: 8089, device_type: DiscreteGpu, backend: Vulkan }
[2022-02-28T13:31:40Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "llvmpipe (LLVM 12.0.1, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, backend: Vulkan }
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Max label length: 256
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::egl] Enabling GLES debug output
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::adapter] Vendor: Mesa/X.org
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::adapter] Renderer: llvmpipe (LLVM 12.0.1, 256 bits)
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::adapter] Version: OpenGL ES 3.2 Mesa 21.2.6
[2022-02-28T13:31:40Z INFO  wgpu_hal::gles::adapter] SL version: OpenGL ES GLSL ES 3.20
[2022-02-28T13:31:40Z INFO  wgpu_core::instance] Adapter Gl AdapterInfo { name: "llvmpipe (LLVM 12.0.1, 256 bits)", vendor: 0, device: 0, device_type: Cpu, backend: Gl }

Platform
Debian testing + X11

@cwfitzgerald cwfitzgerald added api: gles Issues with GLES or WebGL type: bug Something isn't working area: correctness We're behaving incorrectly labels Jun 4, 2022
@cwfitzgerald cwfitzgerald changed the title [OpenGL][Regression] Fail to find hardware adapter Failure to find hardware adapter Jun 4, 2022
@cwfitzgerald cwfitzgerald added area: wsi Issues with swapchain management or windowing and removed area: correctness We're behaving incorrectly labels Nov 3, 2022
@CasualPokePlayer
Copy link

CasualPokePlayer commented Jul 6, 2023

The issue here is that libX11.so simply doesn't exist usually. That .so will only be available if the libx11-dev package is installed. Otherwise, only libX11.so.6 will be available. If the user happens to already have the libx11-dev package (or maybe the distro provides a libX11.so regardless), then this issue ends up going away for them.

@cwfitzgerald
Copy link
Member

So the solution would be to look for libX11.so.6 as well?

@grumpyLxr
Copy link

@cwfitzgerald: Yes that should be the solution. Installing libx11-dev adds a symbolic link from libX11.so to libX11.so.6. So the correct way should be to look for libX11.so and if that cannot be found to look for libX11.so.6.

@cwfitzgerald
Copy link
Member

Alright, happy to have a PR to add that behavior

@vorporeal
Copy link
Contributor

Happy to send a PR for this! One question:

On Wayland, libwayland-client.so.0 is tried before libwayland-client.so. Would we want the same behavior for X11 (libX11.so.6 before libX11.so) or should it be the reverse order, as @grumpyLxr suggested above?

@vorporeal
Copy link
Contributor

Opened #5307 to try loading libX11.so.6 before libX11.so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: gles Issues with GLES or WebGL area: wsi Issues with swapchain management or windowing type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants