Another look at HPET High Precision Event Timer

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by Bukkake, Sep 18, 2012.

  1. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    It was long ago and it was trash talking.
     
  2. Ripan_

    Ripan_ Member

    Messages:
    35
    Likes Received:
    0
    GPU:
    980ti
    Ah okey. But in your opinion what are the pros of having hpet fully on vs hpet - tsc?
     
  3. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    I don`t know what "HPET - TSC" is.
    We know only this: in Win7, Win8+ and older builds of Win10 either TSC or platform timer (HPET, LAPIC) is used for implementation of two Win API functions - QueryPerformanceCounter and QueryPerformanceFrequency. These two functions can be used to measure the time spans with big accuracy/resolution.
    Period.
    We don't know how else Windows uses TSC and platform timers.
    Latest builds of Win10 started to use some new synthetic timer for QueryPerformanceCounter and QueryPerformanceFrequency.
    So when people write "TSC+HPET" in my opinion they just speculate that Windows uses those combos of timers for something.

    As for "HPET vs TSC", in most cases TSC is better (for QueryPerformanceCounter and QueryPerformanceFrequency). Just because TSC is a timer (counter actually, but nvm) right inside CPU core(s), while HPET is a timer (also a counter) which resides somewhere on the motherborad - outside of CPU - and time penalties for its use are big.
     
  4. bobblunderton

    bobblunderton Master Guru

    Messages:
    420
    Likes Received:
    199
    GPU:
    EVGA 2070 Super 8gb
    I toggled this on my i7 4790k system (I don't know if my Ryzen has this option in Bios at all) a year or two ago with Windows 7 and found:
    With HPET on, performance is more consistent.
    With HPET off, performance would speed up in bursts, to be much smoother feeling, but to take away from that, the bursts were inconsistent across the length of time the application was run - bursting in speed/smoothness sometimes more than others. So sometimes the simulation I was running 'felt' slower or faster than with HPET on.
    I was using BeamNG Drive to test, with enough vehicles active to saturate the processor with physics commands.
    General desktop usage 'felt' smoother with it off, so I left it off.
    There was no ill effects to leaving it on or off.
    For doing audio/video production I would leave it on to keep the system more consistent, but this is where you would want Latency Monitor to verify.
     

  5. Ripan_

    Ripan_ Member

    Messages:
    35
    Likes Received:
    0
    GPU:
    980ti

    I thought hpet enables in bios and not in windows was hpet tsc. So do you think I should disable hpet in bios aswell or stay at enabled in bios and not in windows?
     
  6. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Leave HPET "On" in BIOS, and do not set "useplatformclock" in Windows - this combination is considered the best on modern platforms.

    HPET can be used by 3rd party tools (for example, HWiNFO).

    Unfortunately we do not have Windows kernel team programmers here at guru3d. They could enlighten us on the use of timers by OS kernel.
     
  7. Ripan_

    Ripan_ Member

    Messages:
    35
    Likes Received:
    0
    GPU:
    980ti
  8. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Yes.
    If you manually set "usefirmwarepcisettings" you can simply remove it and let Windows decide.

    You should. You can try to game both with HPET on and off and decide by your feelings from gameplay.
     
  9. Ripan_

    Ripan_ Member

    Messages:
    35
    Likes Received:
    0
    GPU:
    980ti

    Do you use usefirmwarepcisettings on?

    Edit: when i disabled hpet in deviceM i got more stability. Thats wierd since i disabled it in cmd before, is it the same?
     
    Last edited: Jan 14, 2020
  10. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Of course not.

    Not the same. In device manager you disable that device, preventing all components of Windows to use it. Through BCD command you forbid Windows to use that device as implementation for certain API functions, allowing other components of Windows to use it.
     
    Tiny_Clanger likes this.

  11. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,015
    Likes Received:
    7,353
    GPU:
    GTX 1080ti
    the hpet driver in device manager doesn't actually have a driver, nor does it actually do anything.
     
  12. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    That does not prevent user (and Windows) to disable the device, right?
     
  13. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,015
    Likes Received:
    7,353
    GPU:
    GTX 1080ti
    you can't disable something that doesn't load any drivers.
     
  14. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Device manager shows not drivers loaded, but devices discovered.
    Many devices without actual drivers show (in resources tab) memory and/or I/O range. These are memory mapped device interface and port device interface.
    If kernel code wants to interact with such device it should write/read the memory address or output/input the port. Are you sure that when device is disabled any code in kernel is still capable to read/write memory range or input/output ports occupied by device? Most probably if device is disabled then accessing memory range or ports does nothing.
     
    Last edited: Jan 15, 2020
  15. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,015
    Likes Received:
    7,353
    GPU:
    GTX 1080ti
    its a common placebo that it does anything, hpet timer still works with the device disabled.
     

  16. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    How can you test that?

    PS This has no logic from PNP subsystem point of view. Device is discovered at boot stage, device claims certain memory range and I/O ports, system shows such device in device manager as enabled and working. If device was disabled by user, PNP subsystem should disable device - thus freeing claimed memory range and I/O ports, and system shows such device in device manager as disabled.

    PPS But of course if PNP subsystem doesn't disable physical device, then such device should be accessible even when disabled in Windows.
     
    Last edited: Jan 15, 2020
  17. Ripan_

    Ripan_ Member

    Messages:
    35
    Likes Received:
    0
    GPU:
    980ti
    When i do a test in csgo with it on i got 423 fps and then i turned it off and did it again and i got 443. Made the test couple of times.

    BUT what also happens is when i join a server the first ten seconds is like im recording with fraps you know when it caps to a lower fps. This doesnt happen later but only when you first start. And it disepears when i turn hpet on in devicem.
     
    Last edited: Jan 16, 2020
  18. Sephiroth

    Sephiroth Member

    Messages:
    19
    Likes Received:
    5
    GPU:
    Asus Rx580 8gb
    Forcing hpet on my intel 2600k and rx580 pc causes inconsistent mouse movement and microstutters in call of duty 4 promod even though its running at 250fps.
     
  19. janos666

    janos666 Ancient Guru

    Messages:
    1,648
    Likes Received:
    405
    GPU:
    MSI RTX3080 10Gb
    I am not an expert but I think Device Manager only disables the driver, not the device itself. Trivial example: try to disable your VGA card and see if you still get picture on your display. Of course you loose all hardware capabilities which would require an appropriate driver but HPET has no such driver to begin with. So, I guess the Windows kernel can still use it after you disabled it in DM. I am not sure about user mode software which tries to access it directly (not through some OS API), that might looses access to the device. This should be fairly easy to test (if you have some software which is know to access HPET for some functionality and has some indication when it happens).
     
  20. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    May be. But one thing I am sure of - user mode code can`t access neither memory mapped ranges nor ports of devices.

    PS As for videocard, it can be that Windows actually will disable OEM driver but will enable fallback VGA one instead. I mean it can treat videocard in special way.
     
    Last edited: Jan 16, 2020

Share This Page