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

Vulkan: After giving error about missing driver, Godot doesn’t exit #58414

Closed
Jayman2000 opened this issue Feb 22, 2022 · 7 comments · Fixed by #62556
Closed

Vulkan: After giving error about missing driver, Godot doesn’t exit #58414

Jayman2000 opened this issue Feb 22, 2022 · 7 comments · Fixed by #62556

Comments

@Jayman2000
Copy link
Contributor

Godot version

4.0.alpha2.official.79077e6c1

System information

Arch Linux (IDK how to give a version for this), virtual AMD Ryzen 5 3600 6-Core Processor, Red Hat Virtio GPU (rev 01), xf86-video-qxl, Vulkan

Issue description

When you run Godot 4 on a system that doesn’t support Vulkan, you get the following:

Godot Engine v4.0.alpha2.official.79077e6c1 - https://godotengine.org
ERROR: No surface extension found, is a driver installed?
   at: _initialize_extensions (drivers/vulkan/vulkan_context.cpp:351)                               
ERROR: Could not initialize Vulkan
   at: DisplayServerX11 (platform/linuxbsd/display_server_x11.cpp:4468)                             
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.


After showing that error, Godot continues to run but does nothing. You have to press Ctrl+C in its terminal before it will actually closes.

Steps to reproduce

  1. Sit down at a machine that doesn’t support Vulkan. Here’s how I created a VM to test this bug:
    1. Download one of Arch’s VM images.
    2. Open GNOME Boxes and import the image.
    3. Install a DE and a DM: sudo pacman -Syu sddm lxqt breeze-icons
    4. Enable the DM: sudo systemctl enable sddm
    5. Reboot.
  2. Run Godot 4 in a terminal

Minimal reproduction project

N/A (Project Manager never loads)

@Calinou Calinou added this to the 4.0 milestone Feb 22, 2022
@Calinou Calinou changed the title After giving error about missing driver, Godot doesn’t exit Vulkan: After giving error about missing driver, Godot doesn’t exit Feb 23, 2022
@Rubonnek
Copy link
Member

Rubonnek commented Jun 30, 2022

@akien-mga I'm particularly affected by this bug. This is the issue I alluded to in #62543.

I'm not sure if it's a Vulkan driver issue in Arch Linux, but the flag --single-window-mode nor --display-driver opengl3 work for me.

With --display-driver opengl3 I get:

Unknown display driver 'opengl3', aborting.
Valid options are 'x11' and 'headless'.

With --single-window-mode or without it I get:

Godot Engine v4.0.alpha.custom_build.1e082914e - https://godotengine.org
ERROR: Method/function failed. Returning: ERR_CANT_CREATE
   at: _create_physical_device (drivers/vulkan/vulkan_context.cpp:816)
ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
   at: _window_create (drivers/vulkan/vulkan_context.cpp:1369)
ERROR: Can't create a Vulkan window
   at: _create_window (platform/linuxbsd/display_server_x11.cpp:4494)

It also happens if I download any of the official builds instead of running my own. I'm not sure what would need to be fixed in the code or if it's a driver issue at the moment.

@Rubonnek Rubonnek reopened this Jun 30, 2022
@akien-mga
Copy link
Member

akien-mga commented Jun 30, 2022

With --display-driver opengl3 I get:

My bad, it's --rendering-driver opengl3 (you can always check --help ;)).

What's your GPU and installed drivers?

@Rubonnek
Copy link
Member

Rubonnek commented Jun 30, 2022

My bad, it's --rendering-driver opengl3

Welp, I was filtering with grep for opengl and I totally missed that flag. I'm able to open the project manager and Editor with that flag as a workaround. Thanks!

Here's is my setup -- I have a Radeon RX 6900 XT:

0c:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c0)
        Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Radeon RX 6900 XT
        Kernel driver in use: amdgpu

As for the driver version, vulkaninfo does not work properly on my system but according to pacman this is all the Vulkan stuff have installed:

extra/amdvlk 2022.Q2.3-1 [installed]
extra/spirv-tools 2022.1-1 (vulkan-devel) [installed]
extra/vulkan-extra-layers 1.3.216.0-1 (vulkan-devel) [installed]
extra/vulkan-extra-tools 1.3.216.0-1 (vulkan-devel) [installed]
extra/vulkan-headers 1:1.3.217-1 (vulkan-devel) [installed]
extra/vulkan-html-docs 1:1.3.217-1 (vulkan-devel) [installed]
extra/vulkan-icd-loader 1.3.217-1 [installed]
extra/vulkan-mesa-layers 22.1.2-1 [installed]
extra/vulkan-radeon 22.1.2-1 [installed]
extra/vulkan-tools 1.3.217-1 (vulkan-devel) [installed]
extra/vulkan-validation-layers 1.3.216.0-1 (vulkan-devel) [installed]

@akien-mga
Copy link
Member

I don't know if Godot supports amdvlk currently, but this GPU should work just fine with the radv driver from Mesa, which is the default on most distros. Not sure why Arch decided to default to amdvlk instead.

See https://wiki.archlinux.org/title/Vulkan#Switching_between_AMD_drivers, you can set AMD_VULKAN_ICD=RADV in your ~/.bashrc to force using radv, or try the amd-vulkan-prefixes commands described in the wiki.

@akien-mga
Copy link
Member

akien-mga commented Jun 30, 2022

@Rubonnek For the record this issue was about Godot not exiting when it throws this error - this is because it was falling back on the headless driver, so the process was still active. #62556 fixes it (and I close the issue by mistake as GitHub seems to have introduced weird shortcuts, but since it's going to be closed when I merge the above PR I guess it doesn't matter).

Since you seem unable to run vulkaninfo with the default amdvlk on Arch, while your GPU definitely can support it, I would suggest you file a bug report with Arch Linux maintainers about it, since it's not directly related to Godot. (And try radv as I suggested which should work.)

@Rubonnek
Copy link
Member

Rubonnek commented Jun 30, 2022

@akien-mga Thanks for the help! I'm finally able to run Godot master branch with a Vulkan driver.

For anyone else that is having issues with their Vulkan drivers, I found my solution on this thread in the Arch Linux forums which is removing amdvlk basically.

# pacman -Rnsc amdvlk lib32-amdvlk

Then the vulkan-radeon driver will be able to load properly.

akien-mga added a commit to akien-mga/godot that referenced this issue Jul 1, 2022
Unless users requested the headless driver specifically, they expect to either
see a window, or that the process terminates if there's an error.

Currently it would fallback to headless so they'd unexpectedly get a valid headless
instance if their DisplayServer failed initializing (e.g. missing Vulkan support).

Fixes godotengine#58414.
@PixsaOJ
Copy link

PixsaOJ commented Aug 19, 2022

I am on Nvidia, probably installed amdvlk as optional dependency for vulkan-loader

Removing it launched Godot 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants