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

Implement automatic OpenGL fallback for GPUs not supporting Vulkan #58927

Closed
Tracked by #66458
Leedoriden opened this issue Mar 9, 2022 · 25 comments
Closed
Tracked by #66458

Implement automatic OpenGL fallback for GPUs not supporting Vulkan #58927

Leedoriden opened this issue Mar 9, 2022 · 25 comments

Comments

@Leedoriden
Copy link

Godot version

alpha 4

System information

win 10

Issue description

when i open Godot alpha 4 exe i've this error messag
Ga4_crash
e

Steps to reproduce

double clic exe

Minimal reproduction project

No response

@akien-mga
Copy link
Member

akien-mga commented Mar 9, 2022

Please provide more information on your system (CPU, GPU, GPU drivers).

@Leedoriden
Copy link
Author

Leedoriden commented Mar 9, 2022

CPU i7 2630QM 2 GHz
GPU NVidia GeForce540M 2Go

GPU Drivers : 391.35-notebook-win10-64bit-international-whql

@akien-mga
Copy link
Member

I think Nvidia doesn't provide Vulkan drivers for the 540M series: https://www.nvidia.com/en-us/geforce/forums/discover/231677/vulkan-support-for-geforce-540m-gt-notebook-/

So you're out of luck to run Godot 4 for now until we have completed the OpenGL 3.3 renderer (it's currently work in progress, you can test it with --rendering-driver opengl3 but it's very limited - only 2D, and lots of things unimplemented still).

Still, it should normally tell you that your GPU doesn't support Vulkan instead of crashing, so we should look into this.

@akien-mga akien-mga changed the title Godot 4.0 alpha 4 crash on start Godot 4.0 alpha 4 crash on start on Windows 10 with NVIDIA GeForce 540M (no Vulkan support) Mar 9, 2022
@akien-mga akien-mga added this to the 4.0 milestone Mar 9, 2022
@Leedoriden
Copy link
Author

same issue with --rendering-driver opengl3
Probably my GPU notebook is too old to run the latest Godot's version

@akien-mga
Copy link
Member

akien-mga commented Mar 9, 2022

same issue with --rendering-driver opengl3

That's weird because the error is related to Vulkan. Are you running it from the console or from a shortcut with Godot_4.0-alpha4_win64.exe --rendering-driver opengl3? It should at least let you open the project manager then (and to open projects you'd have to make sure to select the OpenGL renderer in the New Project creation dialog this is not exposed for now).


@RandomShaper The line it's crashing on is:

    VMA_ASSERT(pCreateInfo->physicalDevice && pCreateInfo->device && pCreateInfo->instance);

I think we should make sure that the VmaAllocatorCreateInfo we pass to VMA is valid on the Godot side, so we can do proper error handling instead of hitting its assert.

We should likely also set NDEBUG on release and release_debug builds as several thirdparty dependencies rely on it to disable debug stuff, including here VMA_ASSERT.

@Leedoriden
Copy link
Author

Leedoriden commented Mar 9, 2022

I run Godot a4 via shortcut with --rendering-driver opengl3
I also setup Exe in NVidia Card ( see pics )

g4_nvidia_setup

Godot runs but some GUI are not visible
Here, i press ENTER to confirm

g4_start

and the result is

g4_start2

@akien-mga
Copy link
Member

@Leedoriden Ah thanks, so it's "working", there's just another bug with multiple window support in the OpenGL renderer on Windows. It's still very early progress so it's not unexpected.

You might be able to work things around with some command line magic if you want to test the editor with OpenGL:

  • Create a new folder for a project
  • Create a text file in that folder named project.godot with these contents:
[rendering]

driver/driver_name="opengl3"
  • Put the Godot .exe in the project folder
  • Make a shortcut in that folder to run the Godot .exe with the -e option (--editor)

@Calinou
Copy link
Member

Calinou commented Mar 9, 2022

--rendering-driver opengl3 should currently always be used with --single-window, as multi-window support is not implemented yet in the OpenGL renderer. This should fix editor and project manager display.

I tried to make --rendering-driver opengl3 imply --single-window, but it doesn't work as expected.

@Leedoriden
Copy link
Author

i followed instructions and this is the result

no 2D & 3D windows ( black GUI )
menus are not clickable / visible, same for the rest of GUI

g4_start3

@Leedoriden
Copy link
Author

with --rendering-driver opengl3 --single-window

menus are visibles & clickables now

2D & 3D are still black GUI

@RandomShaper
Copy link
Member

RandomShaper commented Mar 12, 2022

When I try to simulate a lack of Vulkan drivers on latest master (by running Windows in fail safe mode), I get the following dialog:

image

I'm curious about which flow of failed setup can lead to the message not being shown.

Aside, it's worth mentioning that Godot will end up falling back to the dummy display server and therefore keep running without any window created and nothing shown. I've submitted a PR to avoid that, to be more user friendly: #59074

@sugarsthenewwhite
Copy link

I think Nvidia doesn't provide Vulkan drivers for the 540M series: https://www.nvidia.com/en-us/geforce/forums/discover/231677/vulkan-support-for-geforce-540m-gt-notebook-/

So you're out of luck to run Godot 4 for now until we have completed the OpenGL 3.3 renderer (it's currently work in progress, you can test it with --rendering-driver opengl3 but it's very limited - only 2D, and lots of things unimplemented still).

Still, it should normally tell you that your GPU doesn't support Vulkan instead of crashing, so we should look into this.

I'm not sure if thats entirely true? i have a gt 520 and i ran this test https://github.com/skeeto/vulkan-test which says i can run vulkan but when it comes to godot 4 alpha 12 i get this exact error as the op ;
image

does that test mean anything or??

@Calinou
Copy link
Member

Calinou commented Jul 24, 2022

i have a gt 520 and i ran this test skeeto/vulkan-test which says i can run vulkan

No, Fermi GPUs have never supported Vulkan, no matter the operating system used.

@joemicmc
Copy link

I can reproduce the c++ error if useful. My laptop GPU is GeForce GT 710M and doesn't look like it's supported (downloaded Vulkan SDK and tried to run demo scene). The OpenGL rendering worked better than expected though!

@Calinou
Copy link
Member

Calinou commented Jul 25, 2022

I can reproduce the c++ error if useful. My laptop GPU is GeForce GT 710M and doesn't look like it's supported (downloaded Vulkan SDK and tried to run demo scene). The OpenGL rendering worked better than expected though!

Mobile Kepler GPUs don't support Vulkan either (at least on Windows) – only desktop Kepler GPUs do.

@joemicmc
Copy link

Mobile Kepler GPUs don't support Vulkan either (at least on Windows) – only desktop Kepler GPUs do.

Yep I understand my laptop GPU is not supported, just pointing out I can reproduce the unhandled error so can retest when there's a fix.

@Calinou Calinou changed the title Godot 4.0 alpha 4 crash on start on Windows 10 with NVIDIA GeForce 540M (no Vulkan support) Implement automatic OpenGL fallback for GPUs not supporting Vulkan Aug 11, 2022
@clayjohn clayjohn modified the milestones: 4.1, 4.x Jun 13, 2023
@akien-mga
Copy link
Member

This started as a bug report about a crash, but I think that part was solved.

This issue was then repurposed in a way that's more suitable for a formal proposal, so I'll open one to supersede this issue.

@akien-mga
Copy link
Member

Here we go: godotengine/godot-proposals#8006

Let's keep the discussion on OpenGL fallback in the proposal.

@RpxdYTX
Copy link

RpxdYTX commented Apr 16, 2024

Is this fallback only for the editor? Because it'd be awesome if games could also use this as long as no vulkan specific graphical functions are used

@akien-mga
Copy link
Member

Please see my last comment :)

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

No branches or pull requests