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 BadDrawable #43714

Closed
rares45 opened this issue Nov 20, 2020 · 25 comments
Closed

Vulkan BadDrawable #43714

rares45 opened this issue Nov 20, 2020 · 25 comments

Comments

@rares45
Copy link

rares45 commented Nov 20, 2020

Godot version: v4.0.dev from master -6a683f8

OS/device including version:
Linux Mint 20 Cinnamon
GeForce GTX 1050/PCIe/SSE2

Issue description:
When I try to open Godot it fails. The output:

Godot Engine v4.0.dev.custom_build - https://godotengine.org
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  4
  Resource id in failed request:  0x5600006
  Serial number of failed request:  73
  Current serial number in output stream:  79

I know there are more issues like this, but they are solved by restarting the os, using Wayland, or ensuring that you run on the GPU, but I did all of this, excepting using Wayland because I can't. If you can not help me please tell me how to debug the app, because I am willing to contribute.

Steps to reproduce:

  1. Compile Godot from master using scons -j 8 platform=linuxbsd tools=yes target=release_debug
  2. Run it.
@Calinou
Copy link
Member

Calinou commented Nov 20, 2020

Does it work if you leave out target=release_debug (which makes it use target=debug instead)?

@rares45
Copy link
Author

rares45 commented Nov 20, 2020

Does it work if you leave out target=release_debug (which makes it use target=debug instead)?

No, it's the same error.

@bruvzg
Copy link
Member

bruvzg commented Nov 20, 2020

Major opcode of failed request: 149

This is an error from one of X extensions, opcodes are dynamically assigned.
Please try running Godot again, and provide new opcodes from the error and output of xdpyinfo -queryExt | grep opcode command executed in the same X session, to see which one is responsible?

@rares45
Copy link
Author

rares45 commented Nov 20, 2020

The output is
DRI3 (opcode: 149)

@bruvzg
Copy link
Member

bruvzg commented Nov 20, 2020

It's request from the sync mechanism between X server and kernel, not sure it's gonna help much, seems like a driver issue.

Full failed request info:

┌───
    DRI3FenceFromFD
	drawable: DRAWABLE
	fence: FENCE
	initially-triggered: BOOL
	fd: FD
└───
	Errors: IDchoice, Drawable

	Creates a Sync extension Fence that provides the regular Sync
	extension semantics along with a file descriptor that provides
	a device-specific mechanism to manipulate the fence directly.
	Details about the mechanism used with this file descriptor are
	outside the scope of the DRI3 extension.

Are #38225 and #42348 the same issue?

@rares45
Copy link
Author

rares45 commented Nov 20, 2020

I tried reinstalling the drivers, but no luck. I use the Nvidia proprietary drivers.

#38225 and #42348 do look the same.

@danilw
Copy link

danilw commented Nov 21, 2020

this problem exists on Linux in Nvidia for all Vulkan apps (all apps that draw more than 6 triangles)

for some reason after closing Vulkan app it can not be launched again, it reproduced even on Khronos samples(their HDR demos and compute shader demo can not be launched again before reboot)

I had a similar problem there DiligentGraphics/DiligentSamples#25

(this "bug" randomly fixes by launching OpenGL app, for me most of times X11 error on Vulkan app launch is gone after 2-3 mins using other OpenGL app, and Vulkan start working again)

I do not have this problem with Godot 4.0 on Linux (Nvidia 750, latest drivers), but it "startup" after first time takes minutes...

@rares45
Copy link
Author

rares45 commented Nov 21, 2020

I tried running Godot 4.0 using my CPU(i5-8250U) and it worked. So that confirms it's an Nvidia driver issue. But somehow CS:GO, which is using Vulkan works perfectly.

Should I also open an issue on Nvidia's page?

@danilw
Copy link

danilw commented Nov 21, 2020

But somehow CS:GO, which is using Vulkan works perfectly.

games under DXVK work correctly when they "simple" like CS:GO that do not use complex graphic
as an example - game Risk of Rain 2(from steam in their Proton with DXVK) can not be launched second time after closing, only after ~1min waiting/using OpenGL app, it spam X11 error

Should I also open an issue on Nvidia's page?

you can try... I did not report it to Nvidia (using their forum) because this bug very complex, and ... no one will debug "your app"(Godot), even if you recreate this bug in Khronos samples, that "longer" than a single triangle code... no one gonna waste hours to debug it (in DXVK they do bug-dodge fixes in the DXVK code, DXVK already include alot of Nvidia "dodge bugs" fixes)

reporting bugs in Vulkan is problematic due to the size of code to analyze/debug

@Calinou
Copy link
Member

Calinou commented Nov 21, 2020

But somehow CS:GO, which is using Vulkan works perfectly.

CS:GO uses OpenGL (translated from Direct3D using Valve's ToGL library). Like all games translated using ToGL, it has notorious performance issues on Linux. It's especially noticeable in CS:GO due to the use of more detailed shaders, models and textures compared to all other Valve-made Source 1 games.

Running it via WINE/Proton used to be an option (which effectively let you use D9VK to translate Direct3D 9 to Vulkan), but now that VAC no longer works in WINE, it's not really an option anymore.

Actual Vulkan support will only come if CS:GO is ported to Source 2.

@rares45
Copy link
Author

rares45 commented Nov 21, 2020

CS:GO uses OpenGL (translated from Direct3D using Valve's ToGL library).

Didn't know that.

and ... no one will debug "your app"

well said

After all, what do I do? I wait for Nvidia Drivers update or this bug can be fixed from Godot's side?
I want to contribute to Godot, but I can't without starting the app. I could try myself to fix this, but I don't know where to start.

@danilw
Copy link

danilw commented Nov 21, 2020

CS:GO uses OpenGL

it can be launched from Windows version(in Linux steam), that will use Proton with DXVK as I know, I thought it launched this way

After all, what do I do? I wait for Nvidia Drivers update or this bug can be fixed from Godot's side?

use Windows, or get new 2xxx/3xxx video card(there this bug does not work as I know), or get AMD videocard (amdgpu driver opensource with active development and live bugfixes for all supported videocards), or try other Linux (I use OpenSuse)

this bug exists for 3+ years for sure, first time I saw this bug in Dota2 Vulkan version like 3 years ago, 2 years ago Dota2 Vulkan stop workin on Nvidia at all, and never works again after that(last time I tested in 2019), I do not think they "will fix it" more realistic-they will drop Vulkan support for old cards or something like that

@rares45
Copy link
Author

rares45 commented Nov 21, 2020

use Windows

not an option

or get new 2xxx/3xxx video card, or get AMD videocard

I would love to, but I am on a laptop.

they will drop Vulkan support

Most probably they would do that (because Nvidia is trash, at least on Linux), but the 10' series is not old yet. There are still a lot of new laptops and builds that come with 10' series cards.

amdgpu driver opensource with active development and live bugfixes for all supported videocards

You reminded me of the fact that there is an open-source driver for Nvidia too, and I should check if there is the same problem.

@Calinou
Copy link
Member

Calinou commented Nov 21, 2020

You reminded me of the fact that there is an open-source driver for Nvidia too, and I should check if there is the same problem.

The Nouveau driver does not support reclocking on Maxwell 2 and newer GPUs, which means you will get very low performance (5× slower than the proprietary driver).

@qarmin
Copy link
Contributor

qarmin commented Dec 30, 2020

I have similar error but when creating 2D Node with Godot with GLES 2 (#44399) on Laptop with Intel HD 3000 and Mesa 21.0.0-devel (git-9d59c84e31),

WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/display_server_x11.cpp:3808)
rendering_driver GLES2
window_create window id 1
DisplayServer::_create_window 1 want rect: 350, 100, 900, 700 got rect 350, 100, 900, 700
DisplayServer::_window_changed: 1 rect: 350, 124, 900, 700
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  154 (DRI2)
  Minor opcode of failed request:  7 (DRI2GetBuffersWithFormat	)
  Resource id in failed request:  0x4800051
  Serial number of failed request:  4475
  Current serial number in output stream:  4475

With DRI3 it crash in different place

X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  2
  Resource id in failed request:  0x3e01d66
  Serial number of failed request:  35393
  Current serial number in output stream:  35394

@lawnjelly
Copy link
Member

I have similar error but when creating 2D Node with Godot with GLES 2 (#44399) on Laptop with Intel HD 3000 and Mesa 21.0.0-devel (git-9d59c84e31),

Just seen this - I'm not sure this is related to the original issue. It is highly likely to be me doing something wrong in the X code, I've only tested GLES2 on my own machine so far, and there's been a lot of guesswork involved especially with multi-window. It will have to go through some testing / bug fixing. Sorry been a little delay, I've been temporarily working on BVH as it will help reduz with the rendering server rewrite.

@danilw
Copy link

danilw commented Jan 3, 2021

tested today latest Godot 4 Vulkan build (just build), with latest Nvidia Linux driver 455.45.01
can confirm - Godot 4 absolutely unusable on Linux

Godot 4 freeze on any "text editing", also on opening any menu(popup), Godot 4 even freeze in startup window on creating "new project"(because it has editable text line)

in Godot case I not sure if it Nvidia driver problem or is Godot problem
because launching Godot with Vulkan validation layer result lots of errors
on pressing "New Project" I see this output(and Godot 4 freeze same as without validation layers)

full log pastebin link

@Zireael07
Copy link
Contributor

NVidia driver 455 has problems that were already reported in another issue, and at least two recent dupes - and since rolling back fixes them, I think they are on NVidia side.

@Calinou
Copy link
Member

Calinou commented Jan 3, 2021

@danilw See #41614. As a workaround, enable single-window mode as explained at the top of the issue I linked.

bfloch added a commit to StateOff/godot that referenced this issue Feb 17, 2021
This unblocks launching on Linux laptops that default to the integrated
GPU which can not handle Vulkan in many instances.
Ideally a manual device selection, or an option for the optimal selection
strategy should be provided via CLI or config, but for the time being
this will unblock the Linux devs.

Partially addresses godotengine#42348 and godotengine#43714
@rares45
Copy link
Author

rares45 commented Jun 10, 2021

Update: It still does not start. But this time is a new output:

Using Vulkan Device #0: INTEL - Intel(R) UHD Graphics 620 (KBL GT2)
- Vulkan multiview supported:
  max views: 16
  max instances: 268435455
- Vulkan subgroup:
  size: 32
  stages: STAGE_VERTEX, STAGE_TESSELLATION_CONTROL, STAGE_TESSELLATION_EVALUATION, STAGE_GEOMETRY, STAGE_FRAGMENT, STAGE_COMPUTE
  supported ops: FEATURE_BASIC, FEATURE_VOTE, FEATURE_ARITHMETIC, FEATURE_BALLOT, FEATURE_SHUFFLE, FEATURE_SHUFFLE_RELATIVE, FEATURE_CLUSTERED, FEATURE_QUAD
  quad operations in all stages
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  4
  Resource id in failed request:  0x4a00008
  Serial number of failed request:  110
  Current serial number in output stream:  116

The interesting part is the selected device, because I have my profile set on NVIDIA (performance mode), yet the selected device is the integrated graphics. Also if I set the profile on Intel, Godot starts without a problem so the integrated graphics support Vulkan.

Godot version: 4.0 from master - 9539e4e
This time I'm on Ubuntu instead of Linux Mint.
Drivers: nvidia-driver-460

Also, I don't think this is a driver issue(or at least entirely) because Unreal Engine 5 and others run perfectly.

Just wanted to let you know. Sorry for my English.

@Calinou
Copy link
Member

Calinou commented Jun 10, 2021

@rares45 Can you test this pull request by compiling it locally? Note that it's based on a commit from February 2021, so I suggest to rebase it against the latest master branch by running git rebase master after cloning the fork repository and checking out its vulkan_prefer_discrete_gpu branch.

@rares45
Copy link
Author

rares45 commented Jun 10, 2021

Yes, it works. Now it starts and runs. This seems to solve my issue.

@rares45
Copy link
Author

rares45 commented Jun 10, 2021

Now when trying to create a new sky the Editor freezes. That didn't happen when running with Intel. Is this a known bug or a result of #46070?

@Calinou
Copy link
Member

Calinou commented Jun 10, 2021

Now when trying to create a new sky the Editor freezes. That didn't happen when running with Intel. Is this a known bug or a result of #46070?

Did you create a ProceduralSky, PanoramaSky or PhysicalSky resource? These all work locally here on NVIDIA. I'd recommend opening a new issue for that.

@rares45
Copy link
Author

rares45 commented Jun 11, 2021

It freezes when trying to create the Sky component, right before pressing New Sky. It happens every time. I will start a new issue after I find out more

akien-mga pushed a commit to akien-mga/godot that referenced this issue Jun 11, 2021
This unblocks launching on Linux laptops that default to the integrated
GPU which can not handle Vulkan in many instances.
Ideally a manual device selection, or an option for the optimal selection
strategy should be provided via CLI or config, but for the time being
this will unblock the Linux devs.

Partially addresses godotengine#42348 and godotengine#43714
@rares45 rares45 closed this as completed Jun 17, 2021
@Calinou Calinou added archived and removed archived labels Jun 17, 2021
whereswaldon pushed a commit to gioui/gio that referenced this issue Jan 27, 2022
According to

https://gioui.org/issue/347 and
godotengine/godot#43714

choosing the integrated Intel GPU on a multi-GPU system with NVIDIA
doesn't work well in X11. According to Godot, forcing the use of the
discrete (NVIDIA) GPU works around the problem. This change disables
Vulkan on X11 instead, which is a more conservative and targeted fix.

Disabling Vulkan on X11 will reduce testing of Vulkan, but

- Pierre is making Wayland the default driver on Linux, where Vulkan
is enabled.
- The OpenGL driver will be exercized more.

Fixes: https://todo.sr.ht/~eliasnaur/gio/347
Signed-off-by: Elias Naur <mail@eliasnaur.com>
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

9 participants