Breakpoint Stuttering

0 views
Skip to first unread message

Meggan Shankman

unread,
Aug 3, 2024, 2:43:42 PM8/3/24
to jewshamsode

I can can confirm that conditional breakpoints are performance-consuming in 2021.3 especially to be noticeable when the breakpoint is frequently checked. I use Rider instead of VS so it does not seem to depend on the debugging IDE. I suppose it is not a bug, instead it is probably the way that Unity works in conjunction with the Mono Runtime (I use Mono not IL2CPP, the later will likely handle such breakpoints in another way). Versions before Unity 2021.2 used an older Mono Runtime. They switched the Runtime in the stated version. So this may explain a changed handling for breakpoints and the performance issues now. But absolutely there is potential for optimizations. But because a lot of developers did not even know that conditional breakpoints are existing for debugging purposes this may not be a hot topic for the Unity team

they are just slow, when you do a conditional break point, its more or less always hitting the breakpoint then checking the condition then deciding if it continues or stays at the break point. As a result i never use them in update instead you could just check the condition in real code, then breakpoint inside it.

I added Metal support to RetroArch, a popular open source game front end, and have been troubleshooting an issue where the frame rate will periodically drop below 60fps, causing frame and audio stuttering. To eliminate any issues with RetroArch itself, I ended up creating my own minimal libretro front end and using MTKView's drawInMTKView, which is synchronized with a CVDisplayLink timer. This too had frame stuttering issues when multiple displays are connected. When I limited macOS to a single display, there is no stuttering.

I don't yet know if this is a macOS issue or whether I would need to manage my own CVDisplayLink timer and constantly update which CGDisplay it is associated with. Debugging the minimal front end, I added a symbolic breakpoint to determine how the CVDisplayLink was created for triggering the drawInMTKView. I hit a call to CVDisplayLinkCreateWithActiveCGDisplays during initialization of the MTKView. During initialization, a single call was made to CVDisplayLinkSetCurrentCGDisplay, however, moving the window between displays did not result in further calls to this API.

I'm the author of a streaming app on OSX that no one uses (CocoaSplit) and I've always noticed that if you have CocoaSplit open and it is visible (on another screen) and rendering a preview view of the stream, games have more hitching randomly. I always assumed it was somehow my fault (maybe the rendering code in my app is somehow terrible) but I did a test with OBS and the same thing happened.

Another curious thing. On a single display if you enable Quartz Debug's framerate meter, it is a solid 60fps if HelloTriangle is running. If you attach a second display and run HelloTriangle, quartz debug shows a framerate of 120fps. However, the MTKView delegate's draw method is still called at around 60fps (except when it stutters).

CocoaSplit renders via CAMetalLayer driven by a CVDisplayLink(). I tried making sure the display link was using the display CocoaSplit was rendering to, but that didn't seem to help the problem at all.

If I set preferredFramesPerSecond to 30 instead of 60, when the lag kicks in it is massively bigger than it normally is, as if the stuttering delay is porportional such that the lag at 30 fps is twice as much as 60 fps or maybe even more since it feels like it hangs alot longer. This is clearly Apple's fault.

I actually submitted a bug report for a related display link lag a week or two ago, but got no response from Apple. Also, Apple has been unable to competently respond to my paid technical support requests regarding metal problems either. I am feeling like maybe everyone who actually knew the real stuff is maybe no longer at Apple, and there is no one over there left who can hold a conversation at my level.

My app is a drawing app, and the stuttering is a really painful and bad experience while drawing. I don't have a cable to connect it to the iPad, so I don't know if this is a mac only issue, but I know for a fact I haven't experienced stuttering in the iPad version of my app for the last year, so I don't think it is my code that is the problem.

Btw, it took me the entire weekend to revert back to High Sierra, and the journey was long and hard with many other severe bugs in disk utility, and I am not going to partition my drive again and install mojave for fear of going through that nightmare again. I would guess the root of this bug to be a trivial one liner change in mojave that you should be able to locate with discipline within a day's work by comparing the source files related to CADisplayLink.

I hold high standards for the products I release, and my clients pay because of those high standards. I expect the multi-billion dollar company who has chosen to play the OS role to do their equal share of sincere work, and do the job right.

I had reported this bug early November 2018 (yes, long time ago). After exchanging with Apple engineers in the comments (providing much details and logs) for a few days, they suddently stopped asking questions. I don't know why, but I had no news.

So I finally paid (!!!) for a technical support request to get some update about this issue : the reply was a bit fuzzy, and I really don't know if Apple engineers are still working on this issue. However, they mentionned a workaround : disabling vsync. But this isn't a true workaround, rather a big regression (at least, if you care about rendering quality).

Will 10.14.6 address it? Was the fix just too big for a patch and is going to be included in 10.15? Or will 10.15 exhibit the same behavior? I don't think people would mind waiting for a fix as much if they at least knew that one was coming.

And why you think the problem is in Armory Crate and in the laptop ? The problem can be in you becouse you dont know how to optimize your laptop and your games better .... Also you have mid range laptop ( i have the same ) what do you expect? Another thing is that i have the same laptop and i dont have problems becouse i dont listen some idiots that tell me the armory crate is the problem instead i search for information that can really help me to improve the performance and optimize my system perfect

Thanks for the reply. I don't think its armory crate or my laptop I just I have no clue what is causing it. Even these games that are affected run with the same microstutter no matter the graphics setting. For example I can run the witcher 3 with ray tracing, ultra settings at native res very fluent or even ghost recon breakpoint maxed at very high frame rates buttery smooth, but something like cyberpunk, red dead. and ac mirage on any presets and settings will not stop the stutter even though im still getting a good average framerate on these benchmarks. I am just so confused by the inconsistency with the games it makes it hard to narrow down. I have verified the files and it has not seemed to help on any of the conflicted titles. I also was worried about thermal throttling after reading the second forum you posted but i downloaded a program and checked. it seems like my laptop is running safely within the tdp at good temps. Did you have any issues out of the box? And any more optimization tips for laptop? Maybe there is something i am missing. thanks again.

Lower your graphics in the settings if you use max settings and Ray Tracing this is very hard for that model whit RTX 4060 whit 8GB of video ram the problem maybe is you go out of Video Ram and that couse the problem because that GPU cant run every game at max settings whit ray tracing

Another thing to improve performance is to boost little bit the gpu from the second link that i send you make a custom profile first after this on GPU section apply this Base Clock and Memory Clock save it

Thanks for the information. What I meant was some games I can max out and run fine with no problems. But the games that are affected by stutter can be on all low settings and still get that constant micro stutters so its confusing. Even performance graphs look fine just inconsistent frame pacing. I will have to try the manual mode when I have time and will update if it helped.

Why do i have stutters in multiple games (fortnite, days gone, resident evil, 7 days to die) Why is my card running in the Red Dead redemption 2 main menu with 0mhz and causes spikes and drops in frametime ? Seriously i cant even pause my game ?

Also what was the PSU Output during the tests in Hardware Monitor 64 for 12 & 5.0 & 3.3 Vdc? They all should be -/+ 5% tolerances. For instance the 12 Vdc should have shown a minimum of 11.4 Vdc or higher during the testing.

Edit: If you search the forum, you will find some other users reporting problems with fortnite and days gone. I think the latest drivers mentions fortnite and it should be better, so some problems may be game specific, hopefully the latest driver will help in fortnite.

I'd RMA it at this point, i don't have any experience with RDR2 but that seems very strange. It can be a game problem but I haven't heard a problem like that. Seems voltages etc are fine, I hope you can get a refund or exchange to help you get a good gaming experience back.

Edit: There are AMD reps here, they may respond, the best way to get a dialog with them would be to put in a bug report. I wouldn't wait too long and just RMA it so you can get your problem fixed under warranty.

Bad thing is that 14 days are over, i didnt get to test everything until this week and thats when i noticed all this issues. In my country you have a 14 day return time , if you are unhappy with the product you can simply return it to the reseller however i should have a reason to return it or to call in for RMA.

I have no idea how they respond come monday if they will refund me or if i get a replacement card, im also afraid that this problem will still exist with a replacement card. This is my first AMD card ever. Only 2 weeks ago i was gaming with the 1080ti ( which i sold , sadly) and everything was smooth, sure not the highest FPS anymore but no stutter or weird behavior.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages