turing-smart-screen-python
turing-smart-screen-python copied to clipboard
Monitoring causes GPU stuttering
Describe the bug
Running the main.py causes a constant micro stutter on GPU output, measurablable with tools and noticeable in games (frametimes spike).
To Reproduce
Steps to reproduce the behavior:
- Open a browser page to https://www.testufo.com/animation-time-graph
- Allow the test to settle
- Run main.py
Expected behavior
Monitoring shouldn't impact performance
Gif

Environment:
- Release 2.0.3
- Windows 10
- Python 3.10.6
- AMD 5900x / Nvidia 3080
Additional context
I'd like to see if other people can reproduce this as things like this could have varying degrees of impact depending on a bunch of variables.
I ran Open Hardware Monitor to see if that impacts the GPU the same way and it doesn't so it's either in the gputil lib or way Python calls it?
You can quite a few tests from https://www.testufo.com/ and most of them show frame drops/stuttering when the script is running.
I can replicate this with a quick and dirty test file
import time
import GPUtil
while True:
GPUtil.showUtilization()
time.sleep(1)
Thanks for investigating, issue seems linked to GPUtil though i still need to check behavior with pyadl (AMD GPU) Anyway, the need to integrate OpenHardwareMonitor or alternative would be a better solution, i plan to work on it as soon as i can. Issue would still be present on Linux though. If you have time you can also open this issue on gputil github and link it here.
If you have time you can also open this issue on gputil github and link it here.
I was going to but it's not had much activity in the last few years so I'm not sure if it's still maintained? I'll make one and link it across.
Edit: Done (https://github.com/anderskm/gputil/issues/45)
Fixed in the 2.2.0 release for Windows platforms