ChefKissInc / NootRX

The rDNA 2 dGPU support patch kext. No commercial use.
https://ChefKissInc.github.io/nootrx
Other
512 stars 93 forks source link

Input (video) Latency with NootRX.kext #26

Closed jimgalion closed 5 months ago

jimgalion commented 5 months ago

macOS Version

Monterey

What is your CPU's model?

AMD Ryzen™ 7 5800X

What is your GPU's model?

AMD Radeon™ RX 6700 XT

Please describe the behaviour in detail.

Input (video) latency is present when using NootRX.kext with the AMD Radeon™ RX 6700 XT GPU. This latency is not present when using WhateverGreen.kext with the AMD Radeon™ RX 580 GPU.

tested on latest macOS Monterey and latest macOS Ventura, using a DisplayPort cable.

What should've happened instead?

Latency should be identical in all scenarios, as it would be with WhateverGreen.kext

If applicable, attach the .gpuRestart, .panic, etc file related to this issue.

No response

Bug report submission terms

VisualEhrmanntraut commented 5 months ago

You suuuuuree it's not just a bug with macOS' drivers? Because this kext is not a driver, just adds in the missing parts.

jimgalion commented 5 months ago

i'm not sure that it's not. how might i rule that in / out?

VisualEhrmanntraut commented 5 months ago

@jimgalion Can you try this build? NootRX-1.0.0-RELEASE.zip

jimgalion commented 5 months ago

testing it now- i may have to revisit the older version, i'm still picking up some sort of cursor latency or possibly smoothing. running a 3D title like vkQuake on the build you just sent shows no sign of video latency or mouse latency at all, but i didn't test this on the other build. perhaps the problem isn't video latency, rather a cursor problem?

i did some testing with a 240fps iphone camera: using WhateverGreen, the cursor moves a few frames ahead of the window, while dragging. using NootRX, the cursor always moves exactly in sync with the window dragging, and moves the same way when not dragging the window. could this be suggesting the cursor is drawn differently when using WhateverGreen, as opposed to when using NootRX? this entirely explains the "latency" i'm thinking i was feeling, which was really there, however was exclusive to the cursor movement, but not to actual video output relative to mouse input. (as shown by the lagless 3D vkQuake app)

VisualEhrmanntraut commented 5 months ago

I looked up some stuff about native AMD Navi 2x cards having latency and performance regressions on Hackintosh, and found it was resolved by using the Belknap FB. What that build has is those different settings applied by default. WhateverGreen doesn't really do changes to AMD cards, at least not by default.

VisualEhrmanntraut commented 5 months ago

Also, your card does not even work using WhateverGreen because it's not native (Navi 22), so I don't know the validity of your test. (WEG and NRX conflict)

VisualEhrmanntraut commented 5 months ago

Also what you might be referring to with cursor smoothing, is cursor acceleration which is enabled by default and with no GUI option to change it on macOS

jimgalion commented 5 months ago

to be clear, using WhateverGreen with the RX580, the latency is lower and the cursor moves earlier than the window, in the dragging test, however, if i run OBS, (not recording, just open the program and capture the display)- the cursor latency is present. under NootRX with the RX 6700 XT, the same applies, but the cursor latency is always-present, regardless of what's running or not running.

as for acceleration, i'm very careful to absolutely always have acceleration completely disabled. Smoothmouse for legacy macOS, UnnaturalScrollWheels for 10.14, and LinearMouse for 10.15 - Current. i'm not detecting any mouse acceleration, rather i'm detecting actual latency, but latency that applies only to actual render of the mouse pointer onscreen, not to mouse inputs as a whole. (running a typical 3D video game shows no sign of mouse RawInput latency, but the cursor on the screen is being drawn a few frames late when navigating the desktop)

VisualEhrmanntraut commented 5 months ago

Polaris and Navi have completely different drivers in macOS; different behaviour is expected. Navi's FB uses a mix of old and new Display Core code (see Linux) while Polaris and lower use a custom implementation. The cursor is rendered in hardware, using a surface stream and updated by the driver.

jimgalion commented 5 months ago

i'll have to investigate the OBS issue then, because i can recreate this phenomenon by simply running OBS. it's clear to me that the way the cursor is drawn on the screen changes immediately when OBS opens. that exact same change happens permanentnly anytime i'm using the 6700 XT with NootRX instead of the RX580 with WhateverGreen. i wish i could screen capture what's going on here, but QuickTime screencapture is broken on my system. i don't know of any alternatives to QuickTime and OBS, perhaps i could upload the camera footage to demonstrate. hopefully my explanation is clear enough

VisualEhrmanntraut commented 5 months ago

I think when OBS opens on macOS, it disables V-sync.

jimgalion commented 5 months ago

i also have that option disabled, and even if i didn't --
disabling vsync should decrease latency significantly, not increase it

jimgalion commented 5 months ago

i also don't experience this cursor lag OBS effect on Windows 10, on the same system, same GPUs, so i'm (starting to) think this is a macOS specific issue, not a GPU issue or an OBS issue, likely not even a NootRX issue, however i'm hoping there may be a way to sidestep the whole thing while still using NootRX

just to be as clear as possible: here's the (concise) data

macOS - rx580 - whatevergreen = no cursor lag macOS - rx580 - whatevergreen - obs running = cursor lag win10 - rx580 = no cursor lag win10 - rx580 - obs running = no cursor lag

macOS - rx6700xt - nootrx = cursor lag macOS - rx6700xt - nootrx - obs running = cursor lag win10 - rx6700xt = no cursor lag win10 - rx6700xt - obs running = no cursor lag

jimgalion commented 5 months ago

additionally, i discovered (apparently someone else online has too) that disabling "show cursor" on OBS gets rid of the cursor latency in the rx580 - whatevergreen config. i think macOS might actually be faking the cursor during normal use, and rendering it the same way it renders everything else while capturing it. something about the way macOS handles the Navi 22 might be creating the same scenario, where the cursor is being drawn alongside the rest of the GUI rendering, instead of in another layer , for latency purposes. this might be very similar to the way VMware fakes the cursor rendering, until you tweak some settings, then it renders the real cursor alongside the rest of the render, and that real cursor is subject to the same choppy presentation as the rest of the render, instead of being buttery smooth (and fake)

jimgalion commented 5 months ago

testing even further reveals that the cursor rendering IS changing. toggling "show cursor" actually changes the render on the cursor, and it goes between two different renders. so whatever "show cursor" is triggering macOS to do, that same thing is happening while using the Navi 22 card with NootRX, and if i can sidestep that, i can get back to instant cursor response, instead of the slight delay that just comes along with the macOS GUI rendering

VisualEhrmanntraut commented 5 months ago

Closing as it seems like a macOS issue. If you get a user that uses Navi 23 (which is native) and does not have the issue then I'll investigate further.

jimgalion commented 5 months ago

would you be able to direct me to some more info about the Cursor rendering quirks you mentioned? i think the cursor rendering is the key to this input latency thing, and i won't keep being bothered about the cursor latency if there's simply no way around it, i'll probably sell this GPU and get the 6800 XT, but if there's a way around the quirk, i'd love to investigate some more.