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

Godot slow to open, slow to edit, slow to launch simple game [Windows, caused by specific USB peripherals] #20566

Open
nicklunt opened this issue Jul 29, 2018 · 237 comments · May be fixed by #76810

Comments

@nicklunt
Copy link

nicklunt commented Jul 29, 2018

Bugsquad edit:

This bug has been well confirmed as something that's caused by specific USB peripherals and their drivers, apparently triggering an elusive DirectInput bug on Windows which is only reproducible in specific combinations of hardware (both host and peripheral) and drivers. This seems to trigger particularly some brands of USD keyboards, mice or audio devices (especially Digital Audio Converters).

See https://stackoverflow.com/questions/10967795/directinput8-enumdevices-sometimes-painfully-slow which seems to be the reference StackOverflow issue for this problem. We still don't know how to work this around in a way that wouldn't require users to manually upgrade or disable bogus Windows drivers.


Godot version:

3.0.6 from Steam.
Also same issue on fresh download from https://godotengine.org/
This happened on previous versions too. It's been happening for about 3 months or so.

OS/device including version:

Windows 10 PRO x86_64
Version 1803
OS build 17134.167

GPU Nvidia GTX980ti
GPU driver 398.36

Issue description:

Opening Godot from with steam or from native download takes over 40 seconds.
Opening a very simple project in edit mode takes 35 seconds.
Pressing the play icon on this project from within Godot takes 46 seconds before the game window opens.

Steps to reproduce:
I can reproduce this every time just by opening or creating a basic project.
I get the same issues when I launch one of the demo projects, such as multiplayer pong.

Minimal reproduction project:

Here is the minimal project that takes the time mentioned, but I get this issue on all projects.
Hello Godot.zip

I have also attached the output from the cmd windows that opens when Godot is launched.
cmd_output

@Zireael07
Copy link
Contributor

NVIDIA, huh? I believe there were reports of slow launches on NVIDIA, you could try searching for "NVIDIA" in issues. End consensus was that there is a driver bug.

@Zylann
Copy link
Contributor

Zylann commented Jul 29, 2018

nVidia GeForce GTX 1060 6GB/PCIe/SSE2 here, Godot 3.0.6 opens fine for me (website non-mono version). I know Godot is slightly slower in some cases with nVidia due to bad auto-performance modes, but not that slow (as in 30-second launch instead of 4).

@fossegutten
Copy link
Contributor

GTX 960 and 1070 reporting in with same problems. Slooow launch in windows, fast in linux.
I really wish this could be fixed, as it is my biggest issue with Godot. I like to launch my game all the time to test small tweaks, but takes too much time in windows with my nvidia GPUs.

@cimpresovec
Copy link
Contributor

cimpresovec commented Aug 12, 2018

Joining in on the issue with a GTX 1070. Tried all stable releases of Godot. Also tried on 3 versions of the latest driver 398.98, 398.82, 398.36. But I did notice that the first time (after driver reinstall, computer reboot) it started up quickly. I'll play around with some Nvidia settings when I'll find the time. This is a big issue and should be looked up a bit more.

Edit: I'll reconfirm that the first start after a system restart works normally. Every subsequent startup takes long (40s).

@akien-mga akien-mga changed the title Godot slow to open, slow to edit, slow to launch simple game. Godot slow to open, slow to edit, slow to launch simple game [NVIDIA, Windows] Aug 15, 2018
@volzhs
Copy link
Contributor

volzhs commented Aug 28, 2018

https://www.nvidia.co.kr/Download/driverResults.aspx/137317/en
399.07 driver is released.
would you test with it?

@nicklunt
Copy link
Author

Hey volzhs - yes that seems to have fixed it!
Not had time to do extensive testing yet, but just opened/edited/ran a few games and performance was great.
Thanks for the heads up on the latest driver.

@volzhs
Copy link
Contributor

volzhs commented Aug 28, 2018

I dont know how it affects but driver release note contains this.

[GeForce GTX 1050/1070]: OpenGL driver does not release the rendering context
correctly. [2305430]

@akien-mga akien-mga changed the title Godot slow to open, slow to edit, slow to launch simple game [NVIDIA, Windows] Godot slow to open, slow to edit, slow to launch simple game [NVIDIA drivers bug, Windows] Aug 28, 2018
@akien-mga
Copy link
Member

Great find @volzhs, thanks :)

@fossegutten @cimpresovec Does the update to 399.07 also fix the issue for your cards?

@cimpresovec
Copy link
Contributor

I actually recently did a complete format of my PC and the problem went away with the same driver (398.98). I did try the new driver today and the problem didn't occur. So I don't know what to say. Same driver before and after format but different behavior. I can't say what caused the issue in the previous installation but it deterred me from using Godot.

@nicklunt
Copy link
Author

Unfortunately this has started happening again for me. Godot runs OK for about 1 hour or so, then starts running slow again.

The really strange thing is if I reboot my PC, Godot runs fine for a while again, but then starts going slow.
However, I'm now pretty sure it's not a Godot issue. Might try and get hold of an AMD card and see if that eliminates the problem for good.

@nobuyukinyuu
Copy link
Contributor

nobuyukinyuu commented Sep 1, 2018

GTX750 here; first started noticing slower build and project launch times after a few weeks ago. I figured it had something to do with #21472 (comment) not building with sse2, since I was new to building, but this problem seems to have only gotten worse over the past few weeks, with 3.1a1 having the longest load times yet.

I'm currently running driver 399.07.

Edit: Maybe not a GPU issue? Noticed extremely high CPU usage and low GPU usage during these slow load times. Taking about 27% CPU (an entire hardware thread's allocation on my CPU), drops to normal levels once loading finishes.

Edit2: Not related to this issue, I've filed another issue.

@fossegutten
Copy link
Contributor

Sorry for late answer. Still super slow, with driver 399.24 on GTX 1070 gpu.

@cimpresovec
Copy link
Contributor

The issue is back for me. Well I noticed it when developing some other application with the Raylib library (uses GLFW underneath). The application showed the same behavior as Godot. I then downloaded Godot and the issue was back. I did notice that after a system restart everything works normal, even after multiple separate runs. The issue starts to occur after some time (didn't test) or after running some heavier games on the system and then trying to run Godot. Unity, on the other hand, is not affected but I haven't tried Defold.

@Zireael07
Copy link
Contributor

What could GLFW and Godot have in common?

@cimpresovec
Copy link
Contributor

Both use OpenGL under the hood. As do some other programs that I mentioned that don't exhibit the issue.

@fossegutten
Copy link
Contributor

The issue seems to be Open GL yes. Monogame has same behaviour with OpenGL projects, but not with Direct X projects.

@Zireael07
Copy link
Contributor

Hmm, if the issue exists for all OpenGL things, then it's probably crappy GPU drivers.

@cimpresovec
Copy link
Contributor

The behavior is not consistent across different OpenGL application. Some work just fine (Unity OpenGL builds, Defold engine etc.). It probably depends on the version used but that is just pure speculations. I sadly can't give any concrete help.

@ozebe
Copy link

ozebe commented Oct 21, 2018

same problem here, any tips ?

@CaptainKraft
Copy link

CaptainKraft commented Nov 4, 2018

My startup time isn't in the 30+ seconds range, but around 5 - 10 seconds. It's definitely slower than it should be. I've tried this with an exported executable, and in-engine. It also happens with GLES3 and GLES2.

I'm using a GTX 1080 on driver 416.16
I'll be updating the driver momentarily and will return with a note about any changed.

Edit: The problem persists with driver 416.34, and (possibly unrelated) it seems a bit slow to start Godot itself, as well as opening a project.

@DanX3
Copy link

DanX3 commented Nov 5, 2018

I'm on Linux and I was running NVIDIA drivers 390.87. It really seemed it was running on software rendering since the high CPU usage during scrolling for example.
I installed NVIDIA drivers 410.73 and everything is fine now. Don't know if NVIDIA solved this issues or just re-installing the drivers helped

@AThousandShips AThousandShips modified the milestones: 4.x, 4.3 Apr 12, 2024
@echoless3484
Copy link

Having this fixed will save me, currently building from source to apply a fix, no GPU driver update fixed it, if there are any known peripherals that cause this please let me know.

@steventid
Copy link

I personally have ran into this issue numerous times. I have a NVIDIA RTX 3080 TI, as well as multiple Corsair peripherals running through iCue software. I'm fairly certain the issue is the iCue software, because what's worked for me every time I have experienced the slowdown is to open up iCue, pick either the keyboard or mouse, go to device settings, and change the polling rate from whatever it's currently on to any other setting.

This plays the USB disconnect sound in Windows, then reconnects the device without having to physically disconnect it (since everything's plugged into the back of my tower, physically disconnecting things and reconnecting them is quite annoying)

I can then set the polling rate back to what it was previously and Godot will continue to work as expected for some time. I'm still not sure exactly what triggers it in the first place.

Hopefully this helps someone else until someone's able to fix this issue! :)

@echoless3484
Copy link

echoless3484 commented May 8, 2024 via email

@echoless3484
Copy link

iCue isn't the problem, but guess what is? The Epic Games Launcher. That's right, I use Godot when I turn on my computer and it's perfectly fine, but I close it to play some good ol' Fortnite and open the Epic Games Launcher just to see that there's an update, so I go back to Godot to pass the time and guess what? All of my issues start after opening EGL, I'll update this to see what I have to do to get the Godot engine back up and running normally.

@steventid
Copy link

@echoless3484 I am starting to think that this is more of a random thing that happens and at some point someone is going to have to track this down. I don't play Fortnite and don't even have EGL installed, so that can't be it, at least on my machine.

@echoless3484
Copy link

@echoless3484 I am starting to think that this is more of a random thing that happens and at some point someone is going to have to track this down. I don't play Fortnite and don't even have EGL installed, so that can't be it, at least on my machine.

Yeah, then it has to be, maybe some core library deep down conflicting.

@Invertex
Copy link
Contributor

Invertex commented Jun 13, 2024

iCue isn't the problem, but guess what is? The Epic Games Launcher. That's right, I use Godot when I turn on my computer and it's perfectly fine, but I close it to play some good ol' Fortnite and open the Epic Games Launcher just to see that there's an update, so I go back to Godot to pass the time and guess what? All of my issues start after opening EGL, I'll update this to see what I have to do to get the Godot engine back up and running normally.

Yes it's not ICUE, it's specifically the devices themselves actually.
I have a K70 RGB and was experiencing this issue, even with ICUE completely removed and not services running.
Guess what solved it? Downgrading my keyboard firmware to 1.30.
I have not had the issue since, when before it would happen every few hours and I'd have to flick the keyboard profile switch to cause a device reconnection which would fix the problem temporarily.

This is on Corsair to fix, but I doubt they will care, it's already been complained about on their forums for years.

@Ninety9Balloons
Copy link

Ninety9Balloons commented Jul 20, 2024

I have a Corsair K55 wired keyboard, but iCue isn't installed. I'm getting the 20+ second loading when opening a project or running a scene only when my audio/speakers are plugged in via USB. Unplugging my speakers loading is cut down to less than 5 seconds.

I have GeForce's overlay disabled, a RTX 3080, i9 9900k, 32gb DDR5 RAM, Win11, and everything on a M.2 SSD.

@Invertex
Copy link
Contributor

I have a Corsair K55 wired keyboard, but iCue isn't installed. I'm getting the 20+ second loading when opening a project or running a scene only when my audio/speakers are plugged in via USB. Unplugging my speakers loading is cut down to less than 5 seconds.

I have GeForce's overlay disabled, a RTX 3080, i9 9900k, 32gb DDR5 RAM, Win11, and everything on a M.2 SSD.

Yes, it's the Corsair device itself, not iCUE. If you unplug the keyboard while the issue is happening and then launch Godot, does it also then startup quick? But other brand devices might also have this issue too. It could be unplugging the speakers causes a refresh of devices similar to unplugging the keyboard.

@Ninety9Balloons
Copy link

Unplugging the Corsair keyboard makes no difference. Unplugging the speakers, or just switching Audio from the speakers to anything else (like the monitor) cuts the loading times down to >5 seconds.

E.g. I can keep the keyboard AND speakers plugged in, and if I switch my audio outlet to anything other than the speakers, loading times greatly decrease.

@Invertex
Copy link
Contributor

Strange, are they USB speakers?
First I've heard of that being the issue. Might be worth debugging to see what call it's hanging on, could be a completely separate bug from the DirectInput_EnumDevices() stall.

@Ninety9Balloons
Copy link

Yeah, they're plugged in via USB. No drivers/software associated with them, they're just Klipsch bookshelf speakers. Anything beyond just plugging in/out is above my paygrade, I'm learning Godot from the beginning at the moment.

@pixerhp
Copy link

pixerhp commented Jul 21, 2024

I've had this same problem that the issue describes for a while. I'd be using Godot normally, and randomly it'd start acting extremely slow doing anything, persisting upon relaunching Godot or launching alternate versions. The only solution I could find before was to restart my computer.

I'm glad I just found this issue, as I've now realized that it's related to my USB headphones, relaunching Godot after temporarily unplugging them fixes the problem (and way faster than restarting my pc.)

@elciuk
Copy link

elciuk commented Jul 24, 2024

Same problem as above, seems to be solved by temporarily disconnecting my steelseries arctis 7p+ headphones for some arcane reason. Have not noticed this problem when running linux

@CPSibo
Copy link

CPSibo commented Jul 25, 2024

I have non-USB headphones plugged into a DAC which connects to my PC via USB (so the DAC is seen as the audio source by Windows). With the DAC plugged in, starting a scene takes around 10 seconds. With the DAC unplugged, it takes about 1 second.

Further, if I have the DAC plugged in, unplugging any other USB device outright crashes the godot editor. If the DAC is unplugged, I can add and remove USB devices all I want.

It's unfortunate that this issue hasn't be fixed after all these years.

Godot 4.2.2
Windows 11
AMD RX 7xxx GPU
AMD Ryzen 7 7xxxx CPU
Mayflower O2/ODAC

@Maran23
Copy link
Contributor

Maran23 commented Sep 1, 2024

Anyone know more details here? AFAIK, the USB scanning is done in a thread, so why does this actually stall the editor? Probably something waiting for a response?

@starry-abyss
Copy link
Contributor

From what I understand, in stock Godot it's done on the main thread, and this PR for example moves it to a separate thread: #89363

@Smoik63
Copy link

Smoik63 commented Sep 27, 2024

Sadly I can only add to the list of devices that causes unresponsiveness and long waiting times.

Device that causes the issue:
FiiO Q1 DAC

Godot 4.3
Win 11
AMD Ryzen7 3700X
NVIDIA GeForce RTX 4080
32GB RAM

@danielstenson
Copy link

Same issue here on both mono and non-mono Godot 4.3.

Unsure which device is causing the issue just yet but machine spec is:

  • Godot 4.3
  • Win 11
  • AMD Ryzen7 7800X3D 8-Core
  • TUF Gaming B650-Plus Wifi
  • NVIDIA GeForce RTX 4090 Suprim Liquid X
  • 64GB DDR5 RAM
Godot_Slow_Issue_Video.mp4

I'll try to discover which, if any, external devices might be causing it.

@danielstenson
Copy link

danielstenson commented Sep 30, 2024

Same issue here on both mono and non-mono Godot 4.3.

Unsure which device is causing the issue just yet but machine spec is:

  • Godot 4.3
  • Win 11
  • AMD Ryzen7 7800X3D 8-Core
  • TUF Gaming B650-Plus Wifi
  • NVIDIA GeForce RTX 4090 Suprim Liquid X
  • 64GB DDR5 RAM

Godot_Slow_Issue_Video.mp4
I'll try to discover which, if any, external devices might be causing it.

Quick update on this. I incrementally unplugged each USB device. Each time restarting the Godot.exe. Only after disconnecting the last device did the issue resolve itself. Last device unplugged was a Steelseries Apex 3 keyboard. I've plugged them all back in again and Godot is opening back up in the expected amount of time (See video).

Godot_Slow_Issue_Video_2.mp4

----------- Update -------------

After much playing around with USB ports and devices, restarting the Godot application and also the PC I've discovered that if I plug anything into any USB 2.0 port, restart my PC and (pause for a few moments to let the Windows startup apps load) try to open Godot, it stalls for long periods of time. However, if I move all my peripherals to USB 3.2 Gen 2 ports Godot instantly becomes responsive. Even after multiple restarts this works.

One thing to note if trying to replicate. If you insert a device into a USB 2.0 port and restart the PC, if you try to open Godot the instant that Windows loads, it seems to open instantly. However after closing it and opening back up again in a few moments it begins to hang again.

Hope this helps to replicate the issue.

@felixk525
Copy link

Got the same problem now after getting new hardware. Editor and Godot take ages to load sometimes until i unplug and replug my mouse.
Its a Logitech G502 Hero. If anyone found a solution so far let me know.

@Zireael07
Copy link
Contributor

@felixk525 Did you see the comment which has a permanent workaround? #20566 (comment)

@felixk525
Copy link

@Zireael07 Did not see that one, thanks for pointing it out. Gonna try it later

@SaffronStreams
Copy link

I've also had this problem for a while, since coming from 3.5 and starting to use 4.1. Now on 4.3 stable and the problem persists. In terms of USB devices, I have a razor mouse (G604), logitech webcam, PS4 controller hooked up through USB ports. Have tried disconnecting but seemingly not fixed. Have a Geforce 3080.

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.