Skip to content

examples run, but --bin targets don't #4083

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

Closed
evertedsphere opened this issue Aug 22, 2023 · 2 comments
Closed

examples run, but --bin targets don't #4083

evertedsphere opened this issue Aug 22, 2023 · 2 comments

Comments

@evertedsphere
Copy link

Description
I'm on NixOS. halmark works:

~/c/wgpu trunk* ⇡
nix-shell-env ❯ RUST_LOG=info WINIT_UNIX_BACKEND=x11 WGPU_BACKEND=vulkan cargo run --example halmark
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/examples/halmark`
[2023-08-22T20:02:54Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1.4166666666666667
[2023-08-22T20:02:54Z WARN  wgpu_hal::vulkan::instance] InstanceFlags::VALIDATION requested, but unable to find layer: VK_LAYER_KHRONOS_validation
[2023-08-22T20:02:54Z INFO  wgpu_hal::vulkan::instance] Instance version: 0x4030fe
[2023-08-22T20:02:54Z INFO  wgpu_hal::vulkan::instance] Debug utils not enabled: debug_utils_user_data not passed to Instance::from_raw
[2023-08-22T20:02:54Z INFO  wgpu_hal::vulkan::instance] Enabling device properties2
[2023-08-22T20:02:54Z INFO  halmark] Surface caps: SurfaceCapabilities {
...

and so does raw-gles with those flags, but hello doesn't:

nix-shell-env ❯ RUST_LOG=info WINIT_UNIX_BACKEND=x11 WGPU_BACKEND=vulkan cargo run --bin hello
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/hello`
[2023-08-22T20:03:34Z WARN  wgpu_hal::vulkan::instance] InstanceFlags::VALIDATION requested, but unable to find layer: VK_LAYER_KHRONOS_validation
[2023-08-22T20:03:34Z INFO  wgpu_hal::vulkan::instance] Instance version: 0x4030fe
[2023-08-22T20:03:34Z INFO  wgpu_hal::vulkan::instance] Debug utils not enabled: debug_utils_user_data not passed to Instance::from_raw
[2023-08-22T20:03:34Z INFO  wgpu_hal::vulkan::instance] Enabling device properties2
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Loading Wayland library to get the current display
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Loading X11 library to get the current display
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Using X11 platform
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Enabling EGL debug output
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Display vendor "NVIDIA", version (1, 5)
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	EGL surface: +srgb
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	Trying native-render
[2023-08-22T20:03:34Z WARN  wgpu_hal::gles::egl] No config found!
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	Trying presentation
[2023-08-22T20:03:34Z WARN  wgpu_hal::gles::egl] EGL says it can present to the window but not natively
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	EGL context: +debug
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	EGL context: +robust access
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] 	EGL context: +surfaceless
[2023-08-22T20:03:34Z INFO  hello] Available adapters:
[2023-08-22T20:03:34Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce RTX 3090", vendor: 4318, device: 8708, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "535.86.05", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "llvmpipe (LLVM 15.0.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 23.1.3 (LLVM 15.0.7)", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Max label length: 256
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Enabling GLES debug output
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Vendor: NVIDIA Corporation
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Version: OpenGL ES 3.2 NVIDIA 535.86.05
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] SL version: OpenGL ES GLSL ES 3.20
[2023-08-22T20:03:34Z INFO  wgpu_core::instance] Adapter Gl AdapterInfo { name: "NVIDIA GeForce RTX 3090/PCIe/SSE2", vendor: 4318, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }
[2023-08-22T20:03:34Z INFO  hello]     AdapterInfo { name: "NVIDIA GeForce RTX 3090", vendor: 4318, device: 8708, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "535.86.05", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  hello]     AdapterInfo { name: "llvmpipe (LLVM 15.0.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 23.1.3 (LLVM 15.0.7)", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  hello]     AdapterInfo { name: "NVIDIA GeForce RTX 3090/PCIe/SSE2", vendor: 4318, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Max label length: 256
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::egl] Enabling GLES debug output
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Vendor: NVIDIA Corporation
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] Version: OpenGL ES 3.2 NVIDIA 535.86.05
[2023-08-22T20:03:34Z INFO  wgpu_hal::gles::adapter] SL version: OpenGL ES GLSL ES 3.20
[2023-08-22T20:03:34Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "NVIDIA GeForce RTX 3090", vendor: 4318, device: 8708, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "535.86.05", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  hello] Selected adapter: AdapterInfo { name: "NVIDIA GeForce RTX 3090", vendor: 4318, device: 8708, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "535.86.05", backend: Vulkan }
[2023-08-22T20:03:34Z INFO  wgpu_core::global] Dropping Global

This is mostly the same messages as in #1787, but I'm on X11 with an NVIDIA card.

Repro steps
Ideally, a runnable example we can check out.

Expected vs observed behavior
Clearly describe what you get, and how it goes across your expectations.

Extra materials
Screenshots to help explain your problem.
Validation logs can be attached in case there are warnings and errors.
Zip-compressed API traces and GPU captures can also land here.

Platform
Latest wgpu trunk, NixOS with the following flake.nix:

{
  description = "A devShell example";

  inputs = {
    nixpkgs.url      = "github:NixOS/nixpkgs/nixos-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
    flake-utils.url  = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlays = [ (import rust-overlay) ];
        pkgs = import nixpkgs {
          inherit system overlays;
        };
      in
      {
        devShells.default = pkgs.mkShell rec {
          buildInputs = with pkgs; [
            gcc
            openssl
            xorg.libX11
            xorg.libXi
            xorg.libXcursor
            xorg.libXrandr
            pkg-config
            cmake
            vulkan-headers
            vulkan-loader
            vulkan-tools
            libGL
            fontconfig
          ];

          LD_LIBRARY_PATH="${nixpkgs.lib.strings.makeLibraryPath buildInputs}";
        };
      }
    );
}
@teoxoy
Copy link
Member

teoxoy commented Aug 31, 2023

There isn't anything obvious in the 2nd log. Could you install the vulkan validation layers and try again?

@cwfitzgerald
Copy link
Member

Hello doesn't do anything outside of the one log - the log you pasted looks totally correct.

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

3 participants