godot: Nix build fails to detect vulkan (or any video backend)
Godot version
4.0.dev(f00803b)
System information
NIXOS, nvidia 1650 Max-q
Issue description
Nix build of godot (using this flake) fails to start and gives this error message:
Godot Engine v4.0.alpha.custom_build - https://godotengine.org
ERROR: Could not initialize Vulkan
at: DisplayServerX11 (platform/linuxbsd/display_server_x11.cpp:4744)
Your video card driver does not support any of the supported Vulkan or OpenGL versions.
Please update your drivers or if you have a very old or integrated GPU, upgrade it.
If you have updated your graphics drivers recently, try rebooting.
ERROR: Unable to create DisplayServer, all display drivers failed.
at: setup2 (main/main.cpp:1715)
ERROR: BUG: Unreferenced static string to 0: interface_added
at: unref (core/string/string_name.cpp:131)
- I have verified that vulkan is functioning correctly: vkcube works without a hitch
- opengl is also available and functioning
How does godot detect the video driver? Nix uses non-standard paths for executables, so if godot is scanning for some hardcoded directory, that may be the culprit.
Any Ideas?
Steps to reproduce
This is easily reproduced using this nix flake. Make sure that opengl and vulkan are enabled using the following configuration.nix snippet:
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
environment.systemPackages = with pkgs; [glxinfo vulkan-tools];
Minimal reproduction project
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (16 by maintainers)
nixpkgs currently package beta 10 https://github.com/NixOS/nixpkgs/pull/208160
and newly there is PR open for update to beta 14 https://github.com/NixOS/nixpkgs/pull/212156 So I would recommend all nixos user use version from nixpkgs.
Most buildsystems nowadays call g++ or clang++ directly for the linking step, and the compilers call the relevant linker internally. To pass this kind of linker options you should use
-Wl,-rpath=...
.Patches are very common across nixpkgs, and you don’t have to update them all that often.
It seems that we can pass linker arguments via the scons LINKFLAGS argument. Something like this:
There appears be an issue with incorrect escaping in the scons builder though