Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Neovide: Build against amdvlk #123262

Closed
enderger opened this issue May 16, 2021 · 12 comments
Closed

Neovide: Build against amdvlk #123262

enderger opened this issue May 16, 2021 · 12 comments
Labels
0.kind: bug Something is broken

Comments

@enderger
Copy link
Member

enderger commented May 16, 2021

Describe the bug
Due to an issue with Neovide, some computers need to use the amdvlk driver instead of the standard version. The package works on non-AMD hardware and usually fixes the issue.

To Reproduce
Unfortunately, the issue is inconsistent, however on a number of machines attempting to run Neovide causes the crash. It's a known issue.

Screenshots
Error message:

Ignored client type property: "methods"
Ignored client type property: "attributes"
thread 'main' panicked at 'Failed to create renderer: CreateInstanceError(InstanceError(VkError(ERROR_EXTENSION_NOT_PRESENT)))', src/window/sdl2/mod.rs:456:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional context
See the Neovide install section.

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 5.11.16-300.fc34.x86_64, Fedora, 34 (Workstation Edition)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.4pre20210317_8a5203d
  • channels(daniel): "nixpkgs-21.05pre278688.c0e88185200"
  • nixpkgs: /home/daniel/.nix-defexpr/channels/nixpkgs

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: neovide
# a list of nixos modules affected by the problem
module:
@enderger enderger added the 0.kind: bug Something is broken label May 16, 2021
@teto
Copy link
Member

teto commented May 17, 2021

I wanted to try neovide on another computer with a dedicated GPU but I get on master:

  running: "/nix/store/jabh25wi8r7v2gpkfyhvm9jaxpzgw73x-gcc-wrapper-10.3.0/bin/c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/nix/store/3dwvn3b2wf5ydhrqs0kkzxppzfxig9ih-source" "-Wall" "-Wextra" "-std=c++17" "-DNDEBUG=" "-DSK_R32_SHIFT=16" "-DSK_GAMMA_APPLY_TO_A8=" "-DSK_USE_VMA=" "-DSKIA_IMPLEMENTATION=1" "-DSK_VULKAN=" "-DSK_SUPPORT_PDF=" "-DSK_CODEC_DECODES_JPEG=" "-DSK_ENCODE_JPEG=" "-DSK_USE_LIBGIFCODEC=" "-DSK_CODEC_DECODES_PNG=" "-DSK_ENCODE_PNG=" "-DSK_XML=" "-DSKSHAPER_IMPLEMENTATION=1" "-DSKUNICODE_IMPLEMENTATION=1" "-DU_SHOW_CPLUSPLUS_API=0" "-DSK_SHAPER_HARFBUZZ_AVAILABLE=" "-DSK_UNICODE_AVAILABLE=" "-DU_USING_ICU_NAMESPACE=0" "-DU_DISABLE_RENAMING=" "-DSK_USING_THIRD_PARTY_ICU=" "-o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/paragraph.o" "-c" "src/paragraph.cpp"
  exit code: 0
  running: "/nix/store/jabh25wi8r7v2gpkfyhvm9jaxpzgw73x-gcc-wrapper-10.3.0/bin/c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/nix/store/3dwvn3b2wf5ydhrqs0kkzxppzfxig9ih-source" "-Wall" "-Wextra" "-std=c++17" "-DNDEBUG=" "-DSK_R32_SHIFT=16" "-DSK_GAMMA_APPLY_TO_A8=" "-DSK_USE_VMA=" "-DSKIA_IMPLEMENTATION=1" "-DSK_VULKAN=" "-DSK_SUPPORT_PDF=" "-DSK_CODEC_DECODES_JPEG=" "-DSK_ENCODE_JPEG=" "-DSK_USE_LIBGIFCODEC=" "-DSK_CODEC_DECODES_PNG=" "-DSK_ENCODE_PNG=" "-DSK_XML=" "-DSKSHAPER_IMPLEMENTATION=1" "-DSKUNICODE_IMPLEMENTATION=1" "-DU_SHOW_CPLUSPLUS_API=0" "-DSK_SHAPER_HARFBUZZ_AVAILABLE=" "-DSK_UNICODE_AVAILABLE=" "-DU_USING_ICU_NAMESPACE=0" "-DU_DISABLE_RENAMING=" "-DSK_USING_THIRD_PARTY_ICU=" "-o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/svg.o" "-c" "src/svg.cpp"
  exit code: 0
  running: "ar" "cq" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/libskia-bindings.a" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/bindings.o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/vulkan.o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/gpu.o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/shaper.o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/paragraph.o" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/src/svg.o"
  exit code: 0
  running: "ar" "s" "/build/source/target/x86_64-unknown-linux-gnu/release/build/skia-bindings-c6613dc34168c33d/out/skia/libskia-bindings.a"
  exit code: 0
  GENERATING BINDINGS

  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\', \'libclang-*.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /build/neovide-20210515-vendor.tar.gz/bindgen/src/lib.rs:1896:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Also I wonder if anyone tried the opengl branch ?

@teto
Copy link
Member

teto commented May 23, 2021

cc @ck3d can you reproduce my issue ?

@ck3d
Copy link
Contributor

ck3d commented May 23, 2021

Yes, it was caused by merging stage branch. I created two PRs, one for release-21.05 and one for master:

@ck3d
Copy link
Contributor

ck3d commented May 23, 2021

regarding the main issue:
I use neovide on AMD GPU with video driver amdgpu which is based on mesas vulkan implementation. I did not install amdvkl. Which video driver do you use?

@enderger
Copy link
Member Author

On my Fedora system, I use the Intel drivers (though upon further analysis, Vulkan packages in general don't work well through Nix on it). On my NixOS box (whose error message is simply "could not create surface"), I use the radv drivers.

@ck3d
Copy link
Contributor

ck3d commented May 24, 2021

radv is the default driver which I also use. I tried amdvlk and had also no issues.
Does the application vkcube from package vulkan-tools run on your system?

@gebner
Copy link
Member

gebner commented May 24, 2021

@enderger For Fedora, you probably need to use nixGL: https://github.com/guibou/nixGL

I get the same error with an RX 480, no matter whether I use amdvlk or radv:

Ignored client type property: "methods"
Ignored client type property: "attributes"
thread 'main' panicked at 'Could not create surface', src/renderer/rendered_window.rs:40:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@gebner
Copy link
Member

gebner commented May 24, 2021

Apparently we're not the only ones with issues: #122998 (comment)

@enderger
Copy link
Member Author

Ok, your fix worked on the Fedora machine. However, the NixOS box wouldn't be affected by this. I think that Neovide issue #459 is the culprit for it's issue.

@enderger
Copy link
Member Author

enderger commented May 24, 2021

Here's my NixOS box's vulkaninfo output:

$  vulkaninfo | rg "GPU id :"
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
GPU id : 0 (AMD RADV POLARIS12 (ACO)):
GPU id : 1 (llvmpipe (LLVM 11.1.0, 256 bits)):

@teto
Copy link
Member

teto commented May 24, 2021

I managed to start neovide using the opengl branch and patching manually the program

  neovide = prev.neovide.overrideAttrs(oa:
    let
      rpathLibs = with final.pkgs; [
        libglvnd
        freeglut
        freeglut.dev
        freetype

        vulkan-loader
        xorg.libXcursor
        xorg.libXext
        xorg.libXrandr
        xorg.libXi
        fontconfig
      ];
    in {
    # shellHook = ''echo "hello world"'';
      buildInputs = with final.pkgs; oa.buildInputs ++ [
        libglvnd
        freeglut
        freeglut.dev
        freetype

        vulkan-loader
        xorg.libXcursor
        xorg.libXext
        xorg.libXrandr
        xorg.libXi
        fontconfig
      ];

      shellHook = ''
        echo "run this after build"
        echo 'patchelf --set-rpath "${final.lib.makeLibraryPath rpathLibs}" target/debug/neovide'
      '';
  });

Haven't tried to clean it up yet.

@bnjmnt4n
Copy link
Contributor

This issue can probably be closed since #127506 was merged.

@teto teto closed this as completed Jun 28, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants