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 · 245 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

@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.

@smedelyan
Copy link

smedelyan commented Dec 4, 2024

This is the first issue in google. I will leave another solution that helped me. Use at your own risk.

In short:

  1. Check:
    • copy godot's binaries to a new folder
    • try to launch from there
    • if freezes disappeared (it's quite noticeable even by simply seeing how long it takes to open the project list) then the instruction below will most likely work for you
  2. Open regedit
  3. Edit->Find, look for the "slow" executable you are launching (or part of its name, e.g. in my tests I used godot_isolation01/godot.exe, ...02/godot.exe, etc.)
  4. POTENTIALLY DANGEROUS idk. Remove all keys which have path to your executable or contain the path as value. To me the following two solved the problem, but I removed every key/value mentioning the executable, so maybe something else is missing:
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
    • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\bam\State\UserSettings\S-1-5-21-4286998168-4161747160-1404826615-1000 (I think last part may be different at your end)

I tested this before / after (for some reason at my PC this issue arises quite regularly) with --verbose --benchmark arguments for the engine. Results before the fix (just launching the editor, not even trying to open any project from the list):
Image

Results after the fix:
Image

An interesting thing is that after I copied the same binaries to a different place, freezes have disappeared... for some time :-) and after messing around with the "new" editor a bit (opening-closing project a lot, removing all Godot folders from my user's AppData folders, and -- I'm mentioning this only because after this the issue triggered most often -- applied editor minimal theme from https://github.com/passivestar/godot-minimal-theme with also applying the recommended settings from README).

P. S. I suspect that this might be just a symptom of a problem, so maybe this does not really fix it but rather delay it.

@smedelyan
Copy link

Btw, if the problem is with input, maybe this issue is relevant? godotengine/godot-proposals#9000

@GustJc
Copy link
Contributor

GustJc commented Dec 21, 2024

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.

That did it for me. (windows)
I had yanked my keyboard/mouse by mistake, enough that I heard that usb-disconnect/connect sound.
Immediately, the game I was playing(ballionaire) got stuck non-responding for quite a few seconds then got back to normal.
And later when I tried to work on a Godot project, I noticed that it was taking 20s~ to load each time I tested the game.
To be fair, I think this was happening all over, with other programs too, not exclusive with Godot.

Anyways, un-pluging and plugging the mouse/keyboard back again fixed the slow starts.
This seems be a weird windows/nvidea bug.
(I have not updated my drivers for over 2 years now, so updating the drivers might as well fix the problem too)

@lemonsaurus
Copy link

lemonsaurus commented Jan 5, 2025

I was having an issue with Godot being extremely slow and stumbled upon this thread when searching for a solution.

In my case, it turns out that the slowness was caused by me loading the project off my WSL2 Ubuntu drive. Once I had moved it from that drive to a native Windows 11 drive, it sped up considerably.

@Squidyy
Copy link

Squidyy commented Jan 5, 2025

I was having an issue with Godot being extremely slow and stumbled upon this thread when searching for a solution.

In my case, it turns out that the slowness was caused by me loading the project off my WSL2 Ubuntu drive. Once I had moved it from that drive to a native Windows 11 drive, it sped up considerably.

My projects are saved on my windows 11 drive and I create a symlink in wsl to easily use git cli tools.

@osjupiter
Copy link

I had a similar issue where startup was very slow.
Using a profiler, I found that the delay was caused by Vulkan initialization taking 17 seconds.

Name,Exclusive secs,Inclusive secs,% Exclusive,% Inclusive,Module,Source File,Source Line
RenderingContextDriverVulkan::_create_vulkan_instance	0.00s	17.38s	0.00%	5.77%	godot.windows.editor.x86_64	E:\work\godot\drivers\vulkan\rendering_context_driver_vulkan.cpp	897	0x7ff7504fc4bc

The issue was caused by an old NVIDIA FrameView installation, which had problems with Vulkan settings.
Uninstalling it fixed the issue.

If the slow startup issue is caused by Vulkan, switching rendering methods to Compatibility mode (OpenGL) might speed it up.
Running with --gpu-validation can also show Vulkan logs, which might help identify the problem.
Hope this helps!

@SaffronStreams
Copy link

I have "fixed" the effects of the issue by turning off autosave. Saving manually first and then running the scene takes 10ish seconds maximum in total, where doing it with autosave could take close to 60. (Of course now sometimes you run and forget to save first)

So this doesn't solve the issue but can work as a workaround until we find the core issue. (the NVIDIA hypothesis could be at the root, I think my problems started when I did an update of my drivers)

@bwolfe7
Copy link

bwolfe7 commented Jan 24, 2025

I was able to reproduce this delay/slowness with both Godot_v4.3-stable_win64 and older version of Godot_v4.x.

Steps to reproduce

  1. Plug in a USB DAC (in my case, FX-Audio DAC-X6), set the DAC as my primary audio device in Sound Settings.
  2. Attempt to debug (F5, run) any project
  3. Wait 10s+ for the project to launch

Simple steps to resolve

  1. Unplug the USB DAC (or set any other device as the primary audio output)
  2. Attempt to debug (F5, run) any project
  3. Instantly the project launches

Obviously unplugging your USB DAC on which you rely for audio is a less than ideal solution. Solutions I tried included updating Nvidia drivers, disabling project-level shader cache, unplugging USB devices one at a time, etc. None of that seemed to help.

After a ton of digging and debugging I was able to resolve the issue entirely while also keeping the USB DAC connected and working.

Steps to resolve with USB DAC connected
Open Device Manager -> Open Devices and Printers
Image
Within the devices section, find your USB DAC (or USB headset/other audio devices), right-click -> Properties
Image
Open the hardware tab, select the USB Input Device from the list, click Properties, Change settings (bottom left), select Driver tab, click Disable Device.
Image
Image
Image

As to why this works I have absolutely no clue. The USB DAC is functioning normally and I have not noticed any side effects from disabling this particular USB Input Device. If anyone knows of any, please let me know.

Following these steps will help you properly identify the USB Input Device that needs to be disabled.
For now all version of Godot are snappy when launching games from the editor. I hope this at least helps someone!

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.