turing-smart-screen-python icon indicating copy to clipboard operation
turing-smart-screen-python copied to clipboard

Monitoring causes GPU stuttering

Open Cyruz143 opened this issue 3 years ago • 3 comments

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:

  1. Open a browser page to https://www.testufo.com/animation-time-graph
  2. Allow the test to settle
  3. Run main.py

Expected behavior
Monitoring shouldn't impact performance

Gif Animation

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.

Cyruz143 avatar Sep 21 '22 10:09 Cyruz143

I can replicate this with a quick and dirty test file

import time
import GPUtil

while True:
    GPUtil.showUtilization()
    time.sleep(1)

Cyruz143 avatar Sep 21 '22 11:09 Cyruz143

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.

mathoudebine avatar Sep 21 '22 12:09 mathoudebine

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)

Cyruz143 avatar Sep 21 '22 13:09 Cyruz143

Fixed in the 2.2.0 release for Windows platforms

mathoudebine avatar Dec 13 '22 09:12 mathoudebine