terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Terminal Unresponsive when Playing Games

Open acelinkio opened this issue 1 year ago • 26 comments

Windows Terminal version

1.20.11781.0

Windows build number

10.0.26100.0

Other Software

Steam Any game launched through steam

Steps to reproduce

Start a video game and open Windows Terminal. Windows Terminal becomes unresponsive. This is true for any shell that terminal launches. powershell, cmd, wsl. This is on a fresh install of Windows 11 2024H2 on my Desktop with AMD Ryzen 7950x3d. I have disabled Game Mode and ensured power settings were set to performance.

Please note that a terminal inside of VSCode works without issue while Windows Terminal is entirely unresponsive.

Expected Behavior

No change in Windows Terminal performance when other programs are launching.

Actual Behavior

Windows Terminal freezes. After 3-5 minutes the terminal will accept keystrokes but quickly freeze again.

acelinkio avatar Oct 12 '24 22:10 acelinkio

Turning the setting Use the new text renderer ("AtlasEngine") to Off and relaunching appears to be a workaround.

acelinkio avatar Oct 12 '24 22:10 acelinkio

This isn't an issue that's exclusive to Windows Terminal as it also occurs with Discord for instance. Given that you've got a 7950X3D, I suspect you're not gaming on the iGPU. Can you tell us what GPU you have? I suspect it's an Nvidia one, because I have that issue as well and also have an Nvidia GPU.

My suspicion is that this is a bug in the Nvidia driver and/or with the interaction with DWM. Windows 11 24H2 has the new WDDM 3.2 model after all, plus a ton of new DWM features. It's definitely not a bug in Windows Terminal itself.

lhecker avatar Oct 14 '24 11:10 lhecker

This isn't an issue that's exclusive to Windows Terminal as it also occurs with Discord for instance. Given that you've got a 7950X3D, I suspect you're not gaming on the iGPU. Can you tell us what GPU you have? I suspect it's an Nvidia one, because I have that issue as well and also have an Nvidia GPU.

My suspicion is that this is a bug in the Nvidia driver and/or with the interaction with DWM. Windows 11 24H2 has the new WDDM 3.2 model after all, plus a ton of new DWM features. It's definitely not a bug in Windows Terminal itself.

Running a Nvidia 3090ti. Didn't really consider the terminal was leveraging the dGPU. Your explaination makes sense.

On my prior Windows 11 install I faced a lot of bugs where programs launched with the iGPU. Windows Management and other apps like CPUz for example would take minutes to launch. On that previous install I disabled the iGPU in Device Manager would fix some issues but cause other GUI funkyness. So far Win11 24h2 has been solid without disabling the iGPU in Device Manager outside of Windows Terminal.

Is there a better way to disable the iGPU? I didn't see an option in my motherboard bios. Back in my day as long as you plugged the monitor into the dGPU, you were good.

acelinkio avatar Oct 14 '24 19:10 acelinkio

Didn't really consider the terminal was leveraging the dGPU.

Text was always rendered using the GPU, even on ancient versions of Windows (Windows 2000, etc.), so in that regard nothing has changed. And it doesn't outright use the dGPU either: Instead, it uses your "primary" GPU, which is the GPU where your primary display is connected to. If you were to plug your display into your mainboard instead of your Nvidia GPU we'd use the iGPU.

I don't really recommend disabling the iGPU in Windows as doing so does not save power. It just hides it from Windows while keeping it fully powered, and you don't even get the benefits of having an iGPU anymore. Disabling it in the BIOS on the other hand should have an effect and reduce power draw. There's nothing that the RDNA2 iGPU can do that your dGPU can't so doing that should be safe (since both are about the same age). (But if anything goes wrong, please keep in mind that I can't visit you to fix it. 😄 Everything I'm writing here should not be taken as advice to actually do it.)

I didn't see an option in my motherboard bios.

There are many different locations for that setting, depending on the customization from your mainboard vendor. It's always in the "Advanced" tab, and then sometimes in a "Chipset" or "Onboard" configuration submenu. If it's in none of the submenus in the "Advanced" tab, you can go to "AMD CBS" and then either "NBIO Common Options" or "GFX Configuration" or similar. Within those, there should be a setting to disable the iGPU. Only use the AMD CBS menu if it's not anywhere else. Keep in mind that afterwards you'll need your Nvidia GPU to see anything. If it's ever missing or broken you need to reset your BIOS completely.

That will not solve your issue though. In fact, I don't even have an iGPU. I'll have to report a bug against DWM most likely, and they'll have to investigate this.

Back in my day as long as you plugged the monitor into the dGPU, you were good.

I'm not sure how long those days are past, but I there have been countless major issues over the last 2 decades with both Nvidia and AMD. Here's an example of a longstanding Nvidia bug with ~200 comments: https://github.com/microsoft/terminal/issues/649

lhecker avatar Oct 14 '24 21:10 lhecker

We should leave this issue open so that others won't create duplicates accidentally. I expect this to be a common bug report as people continue to update to 24H2.

lhecker avatar Oct 15 '24 19:10 lhecker

Turning the setting Use the new text renderer ("AtlasEngine") to Off and relaunching appears to be a workaround.

Hello, I do not have this setting and my Windows Terminal freezes/crashes since updating to 24H2 a couple days ago :(

Is there any other fix? I use Windows Terminal daily. I am on Windows Terminal Version: 1.21.2911.0

bptrsn avatar Nov 09 '24 01:11 bptrsn

I have a theory that it may be fixed if you set the background opacity of the window to less than 100 (Settings > Defaults > Appearance). Edit: It seems my theory is correct.

lhecker avatar Nov 10 '24 13:11 lhecker

I have a theory that it may be fixed if you set the background opacity of the window to less than 1 (Settings > Defaults > Advanced). Edit: It seems my theory is correct.

I don't have that setting: Image

bptrsn avatar Nov 12 '24 11:11 bptrsn

Oh, I apologize. I meant to write "Appearance" instead of "Advanced". I fixed my comment.

lhecker avatar Nov 12 '24 17:11 lhecker

Oh, I apologize. I meant to write "Appearance" instead of "Advanced". I fixed my comment.

Ahh I see. Well that just gives a transparent Terminal :D Can't work with that :D I'll try reverting Nvidia driver to older version and see if that fixes it :)

bptrsn avatar Nov 12 '24 18:11 bptrsn

This has been reported as MSFT-55182474 internally.

Personally, I've found that disabling this setting fixed it for me, as another possible workaround: Image

lhecker avatar Nov 22 '24 18:11 lhecker

I got it fixed by playing around with settings in Windows Terminal. I think it was the "Use software rendering (WARP)" one under Rendering that did it. Haven't had WT freeze since.

bptrsn avatar Nov 25 '24 23:11 bptrsn

Ahh I see. Well that just gives a transparent Terminal :D Can't work with that :D

You can set it to 99 and it'll essentially appear as if it's not transparent at all.

I think it was the "Use software rendering (WARP)" one under Rendering that did it. Haven't had WT freeze since.

That will indeed fix it, but I strongly advise against doing that. It's really CPU intensive for no good reason when you have a perfectly fine GPU to use.

lhecker avatar Nov 25 '24 23:11 lhecker

Task Manager says 0 to 0.1% usage, but I'll try your opacity route solution.

You originally wrote "set the background opacity of the window to less than 1", which I thought you meant 0 by haha, I'm guessing it was supposed to say 100.

bptrsn avatar Nov 27 '24 14:11 bptrsn

Task Manager says 0 to 0.1% usage [...]

It depends on what you're doing. If you print a lot of text, it'll be significantly higher. I have an AMD 5950X and it'll produce up to 40% load and consume >30W. If I use my GPU on the other hand, it produces <1% load and consumes <4W. Software rasterization, aka WARP, also runs across all CPU cores which is not ideal during gaming because it may steal the game's time slices. It should only ever be used as an option of last resort, because CPUs are simply not good at emulating GPUs.

You originally wrote "set the background opacity of the window to less than 1", which I thought you meant 0 by haha, I'm guessing it was supposed to say 100.

Oh, it's because the value is a percentage, so I meant "less than 1" as in "less than 100 percent". 😅 I apologize for that.

lhecker avatar Nov 27 '24 16:11 lhecker

Task Manager says 0 to 0.1% usage [...]

It depends on what you're doing. If you print a lot of text, it'll be significantly higher. I have an AMD 5950X and it'll produce up to 40% load and consume >30W. If I use my GPU on the other hand, it produces <1% load and consumes <4W. Software rasterization, aka WARP, also runs across all CPU cores which is not ideal during gaming because it may steal the game's time slices. It should only ever be used as an option of last resort, because CPUs are simply not good at emulating GPUs.

You originally wrote "set the background opacity of the window to less than 1", which I thought you meant 0 by haha, I'm guessing it was supposed to say 100.

Oh, it's because the value is a percentage, so I meant "less than 1" as in "less than 100 percent". 😅 I apologize for that.

Okay thanks for the explanation :)

Is there an issue here on Github I can track regarding this bug? I have several other programs where I can't disable hardware acceleration and they freeze too. Is it on Nvidia or Microsoft to fix?

bptrsn avatar Nov 29 '24 14:11 bptrsn

This is caused by Hardware Accelerated Graphics Scheduling option combined with high gpu load, its an old issue dating back to the initial implementation of HAGS in 2020 on NVIDIA drivers.

AMD is affected in the opposite direction on the RDNA parts that support it, gaming suffers disproportionately when activity is present on the other window.

Squall-Leonhart avatar Dec 01 '24 06:12 Squall-Leonhart

This is caused by Hardware Accelerated Graphics Scheduling option combined with high gpu load, its an old issue dating back to the initial implementation of HAGS in 2020 on NVIDIA drivers.

AMD is affected in the opposite direction on the RDNA parts that support it, gaming suffers disproportionately when activity is present on the other window.

For me this is a brand new issue, only happening on 24H2. Considering reverting back cus it's damn annoying :(

bptrsn avatar Dec 01 '24 20:12 bptrsn

The good news is that the issue is not caused by Accelerated Graphics Scheduling. Whatever issue you're seeing in that regard is unrelated to this issue.

This issue is currently being addressed internally, and if everything works out, a bug fix should be released in the near term (early next year?).

lhecker avatar Dec 03 '24 22:12 lhecker

The good news is that the issue is not caused by Accelerated Graphics Scheduling. Whatever issue you're seeing in that regard is unrelated to this issue.

Lmao, yes it is.

Discord, Terminal, Steam, Web browsers, all go to crap when HAGS is on and a GPU is under heavy load.

Let it run on a iGPU via the preferred gpu settings and its all fixed.

Squall-Leonhart avatar Dec 04 '24 05:12 Squall-Leonhart

The good news is that the issue is not caused by Accelerated Graphics Scheduling. Whatever issue you're seeing in that regard is unrelated to this issue.

Lmao, yes it is.

Discord, Terminal, Steam, Web browsers, all go to crap when HAGS is on and a GPU is under heavy load.

Let it run on a iGPU via the preferred gpu settings and its all fixed.

I'm getting freezes by alt-tabbing, I don't need high load on my GPU, just need to alt-tab between apps like Terminal, Apple Music, some game.

bptrsn avatar Dec 04 '24 22:12 bptrsn

I'll confirm that the 99% opacity fix worked for me.

kemayo avatar Dec 26 '24 19:12 kemayo

This happens exclusively when the terminal is on the same monitor as the gpu-demanding application. Moving the terminal to a different monitor prevents the issue. This doesn't even need to be a "game", any high gpu load results in a freeze, e.g. firefox+webgl or blender. (AMD drivers, 24.12.1)

namarrgon avatar Dec 29 '24 13:12 namarrgon

I got it fixed by playing around with settings in Windows Terminal. I think it was the "Use software rendering (WARP)" one under Rendering that did it. Haven't had WT freeze since.

It works for me. Thx.

mxi1 avatar Feb 09 '25 10:02 mxi1

+1 on the opacity fix. This was driving me crazy for months and I finally noticed this was only happening when I have a game open.

valdotdev avatar Feb 17 '25 08:02 valdotdev

+1 on the opacity fix. This was driving me crazy for months and I finally noticed this was only happening when I have a game open.

it worked for me as well but now my cursor is missing

xbbdc avatar May 03 '25 20:05 xbbdc

this has been an issue for me

xochtil-xerxes avatar May 07 '25 18:05 xochtil-xerxes

Image Changing this to Direct3D 11 fixes the issue for me. 7th Gen. Ryzen iGPU + NVIDIA dedicated GPU

dnzrx avatar May 15 '25 23:05 dnzrx

Image Changing this to Direct3D 11 fixes the issue for me. 7th Gen. Ryzen iGPU + NVIDIA dedicated GPU

thanks, i got the cursor back!

xbbdc avatar May 16 '25 00:05 xbbdc

This has been reported as MSFT-55182474 internally.

Personally, I've found that disabling this setting fixed it for me, as another possible workaround: Image

This setting is a hack to enable VRR on the few D3D11 fullscreen windowed (not flipmode) games that shipped on the MS store, it should not have been enabled as a set-and-forget, it makes sense it breaks the windows terminal, and chrome based stuff.

Edit: It does benefit a few fullscreen window games on steam too, but the argument stands, it's a hack and its default value is OFF.

Squall-Leonhart avatar Jun 27 '25 02:06 Squall-Leonhart