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

Very High CPU Usage when in game and D2DX window not in focus #178

Open
eleriaqueen opened this issue Oct 1, 2022 · 2 comments
Open

Very High CPU Usage when in game and D2DX window not in focus #178

eleriaqueen opened this issue Oct 1, 2022 · 2 comments

Comments

@eleriaqueen
Copy link

eleriaqueen commented Oct 1, 2022

Yeah, D2DX is exhibiting very high single core CPU usage (100 %) when in game and only if window is not in focus. I tested both SP and TCP-IP on D2 version 1.14d and 1.10f.

Edit : It might be that D2DX would need to do the window sleeping and to check if window has focus again ? (It seems a DX11 app made with the ImGui project can exhibit similar behavior, maybe it's a DX11 quirk)

I'm using Win 10 with an Alder Lake CPU (Intel Gen 12) and GTX 1660 Ti graphics card.

Tried forcing vsync, a max background game framerate cap, to no avail.

Here are my D2DX settings :

[window]
scale=2			# range 1-3
position=[-1,-1]	# if [-1,-1] the window will be centered, otherwise placed at the explicit position given here
frameless=false         # if true, the window frame (caption bar etc) will be removed

[game]
size=[-1,-1]		# if [-1,-1] d2dx will decide a suitable game size, otherwise will use the size given here
filtering=0             # if 0, will use high quality filtering (sharp, more pixelated)
                        #    1, will use bilinear filtering (blurry)
                        #    2, will use catmull-rom filtering (higher quality than bilinear)

#
# Opt-outs from default D2DX behavior
#
[optouts]
noclipcursor=true	 # if true, will not lock the mouse cursor to the game window
nofpsfix=false		 # if true, will not apply the basic fps fix (precludes high fps support)
noresmod=false		 # if true, will not apply the built-in D2HD resolution mod (precludes widescreen support)
nowide=false		 # if true, will not choose a widescreen resolution (if noresmod is true, this does nothing)
nologo=false		 # if true, will not display the D2DX logo on the title screen
novsync=false		 # if true, will not use vertical sync
noaa=false		 # if true, will not apply anti-aliasing to jagged edges
nocompatmodefix=true	 # if true, will not block the use of "Windows XP compatibility mode"
notitlechange=false	 # if true, will not change the window title text
nomotionprediction=false # if true, will not run the game graphics at high fps
@eleriaqueen
Copy link
Author

eleriaqueen commented Oct 6, 2022

I looked at D2DX source and poked around, and It seems that the "sleep patches" are part of the problem.

if (ProbeUInt32(_hD2ClientDll, 0x2684, 0x15FF0A6A))
{
    PatchUInt32(_hD2ClientDll, 0x2684, 0x90909090);
    PatchUInt32(_hD2ClientDll, 0x2688, 0x90909090);
}

The 1.10 sleep patch disables the 10 ms sleep and makes things a bit worse for that version of the game.
By disabling it my CPU usage doesn't go up when alt tabbing, but It still gets high when quickly switching from the game to another window without using Alt+Tab.

@kradear
Copy link

kradear commented Jan 16, 2023

I'm encountering the same problem. Any time I minimize the window the fans ramp up, turbo boost takes over and the CPU gets very hot.

Any solution?

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

No branches or pull requests

2 participants