ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
471 stars 38 forks source link

Dota 2 Not Identifying CPU Correctly, FPS Issues #2814

Closed Zeeeze closed 1 month ago

Zeeeze commented 1 month ago

Your system information

System information from steam (Steam -> Help -> System Information) in a gist: If on Linux, please include Steam -> Help -> Steam Runtime Diagnostics in the gist: Done Have you checked for system updates?: Yes Are you using the latest stable video driver available for your system? Yes Have you verified the game files?: Yes

Please describe your issue in as much detail as possible:

This is an issue I've had since moving to Linux from Windows where it did not exist.

I've had this issue now with two Skylake-X processors (an older one that died and I replaced with a different model and this one) where I get a very low framerate in Dota 2 with low GPU and CPU utilization. I found a launch option that was able to resolve this issue when using my previous CPU (in both Counter Strike and Dota 2), -disable_affinity_preferences, however that launch option is no longer resolving the issue on my replacement which is an older and weaker model. So I began to dig more to try and resolve the issue again.

The thing I noticed while running mangohud and expanding to show all CPU cores, was 100% utilization on a single core, and very low utilization elsewhere which was odd as this is a 10 core 20 thread CPU. I noticed on the older CPU, when running the -disable_affinity_preferences launch command, I had a very uniform distribution of utilization across the CPU of around 20-30% per core, which while not ideal somehow culminated in a good framerate and GPU usage. So I tried another command on the same reddit post, -threads and selected 5 and 9 as arguments, which has once again resulted in a good framerate and good utilization on the new CPU. That post warned about -threads not being ideal to use and so I started digging into the sys_info section of the console where I may have found what I believe to be the issue.

You'll see this in the attached sys_info copy paste, and I am not a game developer and so apologize for any incorrect terminology, but the issue appears to be in Dota's recognition of my CPU hardware and deciding how many threads to use.

In the first paste with no launch options, you can see it has correctly identified it as an Intel 7900X, but appears to have incorrectly marked it as having only 1 P core and 6 E cores, while also assigning it a thread pool of 0.

In the second paste, you'll see the same in regards to the CPU, but using the -threads 5 launch option has given it a thread pool of 4, and performance in game is fine and/or better than when I was on windows.

All of this to say I hope that this provides value and can be resolved as I don't enjoy using advanced launch options to force game compatibility with my operating system (and especially a native client), and if this issue is more widespread it might explain the significant (from what I've read at least) performance challenges a lot of users are reporting in Dota and Counter Strike when moving to Linux from Windows. Thanks for reading.

sys_info paste 1 where I have no launch options:

Time: Wed Sep 11 12:49:17 2024 Process: 64-bit, OS: 64-bit Process priority: normal, main thread priority: CPUs: 20 CPUs (10 cores - 1P/6E), Frequency: 3.3 GHz, Features: F/M/S 6/85/4 GenuineIntel SSE SSE2 SSE4.1 SSE4.2 AVX AVX2 MMX RDTSC RDTSCP CMOV FCMOV PCLMULQDQ CPU brand information: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Engine thread pool: 0 thread(s) Render system: Vulkan Driver Name: NVIDIA GeForce GTX 1080 Driver Version: 550.107.2.0

sys_info paste 2 where I have manually used the "-threads 5" launch option:

Time: Wed Sep 11 12:56:22 2024 Process: 64-bit, OS: 64-bit Process priority: normal, main thread priority: CPUs: 20 CPUs (10 cores - 1P/6E), Frequency: 3.3 GHz, Features: F/M/S 6/85/4 GenuineIntel SSE SSE2 SSE4.1 SSE4.2 AVX AVX2 MMX RDTSC RDTSCP CMOV FCMOV PCLMULQDQ CPU brand information: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Engine thread pool: 4 thread(s) Render system: Vulkan Driver Name: NVIDIA GeForce GTX 1080 Driver Version: 550.107.2.0

Steps for reproducing this issue:

N/A

kisak-valve commented 1 month ago

Hello @Zeeeze, can you copy the output of cat /proc/cpuinfo and lscpu -e to a gist and share a link to the gist?

Zeeeze commented 1 month ago

Attached: cat /proc/cpuinfo https://gist.github.com/Zeeeze/869c0664ec070e02d05ff75f1e1f3167 lscpu -e https://gist.github.com/Zeeeze/9851df49b4b2bd2f01b86813f3cdf5f3

gdrewb-valve commented 1 month ago

Hello @Zeeeze, can you try again with the latest Dota? There was an update yesterday that might address this.

Zeeeze commented 1 month ago

Hi there, yes, I checked after the patch yesterday and noticed it was resolved but didn't want to jump and close this. sys_info now correctly outputs the number of cores and the game is assigning the correct thread pool without needing the -threads launch option:

Time: Wed Sep 18 02:24:30 2024 Process: 64-bit, OS: 64-bit Process priority: normal, main thread priority: CPUs: 20 CPUs (10 cores), Frequency: 3.3 GHz, Features: F/M/S 6/85/4 GenuineIntel SSE SSE2 SSE4.1 SSE4.2 AVX AVX2 MMX RDTSC RDTSCP CMOV FCMOV PCLMULQDQ CPU brand information: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Engine thread pool: 9 thread(s) Render system: Vulkan Driver Name: NVIDIA GeForce GTX 1080

I do still need to use the -disable_affinity_preferences option in order to have a reasonable frame-rate (low GPU and CPU usage otherwise), but that is a separate issue that I don't believe will be resolved here.

gdrewb-valve commented 1 month ago

Have you tried without -disable_affinity_preferences recently? That option shouldn't make any difference.

Zeeeze commented 1 month ago

It had been necessary a few months ago when I switched to Linux (was the only thing that took me from 25fps to 200fps due to low cpu and gpu usage) and was required in both counter strike 2 and dota 2 (and so I chalked it up to an issue with source games or native linux clients).

I had left it like that until ringmaster had come out (but tested intermittently and found it still necessary when I did) and I started having this issue, but you're right, dota worked fine just now without that launch option. Thanks!

However, I did go back just now to test counter strike 2 and have found the launch option still necessary. I've attached screenshots with performance monitoring from mangohud to show I'm not crazy! The performance discrepancy used to be even worse in dota between using that launch option and not.

Notice the distributed and heavier CPU load with the option on (and correspondingly higher GPU usage and framerate).

I know this is the dota github so not sure if you can help, but just wanted to highlight what's been going on since it's received some level of attention. Thanks again though!

Screenshot from 2024-09-18 15-30-54 Screenshot from 2024-09-18 15-42-07

gdrewb-valve commented 1 month ago

I don't have direct knowledge but my guess is that CS2 hasn't shipped the underlying changes yet. When they catch up to Dota things should behave the same between the two but I don't know when that'll be. Keeping -disable_affinity_preferences isn't harmful so go ahead and stick with that.