Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still slow 3D performance in Games in macOS with AMD cpus #5

Closed
tomnic79 opened this issue May 17, 2020 · 28 comments
Closed

Still slow 3D performance in Games in macOS with AMD cpus #5

tomnic79 opened this issue May 17, 2020 · 28 comments

Comments

@tomnic79
Copy link

CPU: AMD Ryzen R9 3950X
GPU: AMD XFX Radeon VII 16Gb HBM2
macOS version: Catalina 10.15.4
15h/16h or 17h: 17h patches in "real" mode (OC 0.5.8)
I am using and can reproduce on the latest patches: Yes

Hi everybody, can we find a way to boost the 3d performance with AMD cpus and macOS?

I know that kernel patches are slowing down those performances... in fact if I try Proxmox (so no patches, OC 0.5.8) with my setup I can get 30% more 3d performance (eg. CineBench 15 OpenGL test) and really faster rendering in Xonotic benchmark (min fps is 15, with patches I get 5 as minimum).

Can anybody update those 17h patches? Is there any way to fix this poor 3D performance other than running Proxmox?

@riverscn
Copy link

@tomnic79
Copy link
Author

Thanks, but the only numbers going up are the Geekbench benchmark results... no real gains in those two tests... even Rise of the tomb raider stutters a lot!!! But the same hardware under Proxmox and without radeonboost performs at least 30% better in those tests...

@Slaaash
Copy link

Slaaash commented May 27, 2020

I have got same problem with perfomance in game, results in benchmark5 are good, rx580 in opencl test has 36619 scores, in metal has 58851. But in game with the both settings fps is too low and when i resizing window in google chrome while playing video on youtube it freezes.

@tomnic79
Copy link
Author

tomnic79 commented Jun 6, 2020

If I put these 15h/16h patches in my config.plist I can boot:

<dict>
	<key>Base</key>
	<string>_cpuid_set_info</string>
	<key>Comment</key>
	<string>algrey - cpuid_set_info - cores and threads calculations - 10.15</string>
	<key>Count</key>
	<integer>1</integer>
	<key>Enabled</key>
	<true/>
	<key>Find</key>
	<data>
	uTUAAAAPMkjB4iCJwUgJ0bkBAAEAD0XID7fBwekQg+EP6x65NQAAAA8ySMHi
	IInBSAnRuQEAAQAPRcgPt8HB6RA=
	</data>
	<key>Identifier</key>
	<string>kernel</string>
	<key>Limit</key>
	<integer>0</integer>
	<key>Mask</key>
	<data>
	</data>
	<key>MaxKernel</key>
	<string>19.99.99</string>
	<key>MinKernel</key>
	<string>19.0.0</string>
	<key>Replace</key>
	<data>
	uAgAAIAx2zHJMdIPokGJzkUPtvZB/8ZEifFEifBmDx+EAAAAAABmDx+EAAAA
	AAAPH4QAAAAAAOl8////Dx9EAAA=
	</data>
	<key>ReplaceMask</key>
	<data>
	</data>
	<key>Skip</key>
	<integer>0</integer>
</dict>

<dict>
	<key>Base</key>
	<string>_cpuid_set_info</string>
	<key>Comment</key>
	<string>algrey - cpuid_set_info - cores and logicals count - part 2</string>
	<key>Count</key>
	<integer>1</integer>
	<key>Enabled</key>
	<true/>
	<key>Find</key>
	<data>
	uTUAAAAPMkjB4iAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
	</data>
	<key>Identifier</key>
	<string>kernel</string>
	<key>Limit</key>
	<integer>0</integer>
	<key>Mask</key>
	<data>
	//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA=
	</data>
	<key>MaxKernel</key>
	<string>18.99.99</string>
	<key>MinKernel</key>
	<string>17.0.0</string>
	<key>Replace</key>
	<data>
	ichmDx+EAAAAAABmDx+EAAAAAABmDx+EAAAAAAAPHwA=
	</data>
	<key>ReplaceMask</key>
	<data>
	</data>
	<key>Skip</key>
	<integer>0</integer>
</dict>

But if I put the tsc init of the 15h/16h patches my system cannot boot, it hangs here:

IMG_20200605_192340

@tomnic79
Copy link
Author

tomnic79 commented Jun 6, 2020

...and no, booting with the two patches I posted above doesn't help graphics performance, I only get a wrong cpu cores / thread count ... we need to tweak this init tsc 15h/16h patch to make it work with zen 2 cpus and see if we can boost graphics performance:

<dict>
	<key>Base</key>
	<string></string>
	<key>Comment</key>
	<string>algrey - tsc_init - grab DID and FID from MSR</string>
	<key>Count</key>
	<integer>1</integer>
	<key>Enabled</key>
	<true/>
	<key>Find</key>
	<data>
	uZQBAAAPMonDuc4AAAAPMg+2zokNAAAAAA+2xIkFAAAAAA==
	</data>
	<key>Identifier</key>
	<string>kernel</string>
	<key>Limit</key>
	<integer>0</integer>
	<key>Mask</key>
	<data>
	////////////////////////////AAAA////////AAAA/w==
	</data>
	<key>MaxKernel</key>
	<string>19.99.99</string>
	<key>MinKernel</key>
	<string>17.0.0</string>
	<key>Replace</key>
	<data>
	uXEAAcAPMonASInBSMHpBoPgP0iDwBCA4QdI0+gPH0QAAA==
	</data>
	<key>ReplaceMask</key>
	<data>
	</data>
	<key>Skip</key>
	<integer>0</integer>
</dict>

@memegauste
Copy link

memegauste commented Jun 16, 2020

image

I wanted to test an game, I got ~25-30fps under MoltenVK->DXVK game which is FF XIV, on rx5700 XT and r5 3600. Since I own game on Windows but I don't played it so much, I don't know if this is low, but I suspect it is (will do futher testing today).

(And yes, on my Hackintosh this is not even 4K but upscaled 4K).

If anybody wants to help with performance just reply to me here.

@Romanychev
Copy link

3600X/RX580 - +-30fps
2700/5600XT - +-35fps.

Problem only AMD Ryzen hakintosh (9600k/RX580 - 140+ fps).
Benchmark gickbench also gives a bad result (+-30k vs 55k with intel - compare, metal).

@tomnic79
Copy link
Author

https://www.dropbox.com/s/l39ls1mh58c2tk0/VID_20200614_145659.mp4?dl=0 Minecraft, R9 3950X AMD Radeon VII @ 4k, vsync disabled - 40-60 fps

https://www.dropbox.com/s/rxrl16dvz2csqmd/VID_20200614_125851.mp4?dl=0 Minecraft, R9 3950X, AMD Radeon VII @ 4k, vsync disabled... Proxmox ;) - 180-300 fps

@memegauste
Copy link

https://www.dropbox.com/s/l39ls1mh58c2tk0/VID_20200614_145659.mp4?dl=0 Minecraft, R9 3950X AMD Radeon VII @ 4k, vsync disabled - 40-60 fps

https://www.dropbox.com/s/rxrl16dvz2csqmd/VID_20200614_125851.mp4?dl=0 Minecraft, R9 3950X, AMD Radeon VII @ 4k, vsync disabled... Proxmox ;) - 180-300 fps

Sounds like Proxmox is oddly superior, but I prefer Vanilla methods that running macOS in VM.
I'm also curious if Acidanthera couldn't fix that with some own magic, also they could implement OPEMU support but I see nobody has time and effort to do this, sadly.

I want to believe somebody will investigate that finally.

@naveenkrdy naveenkrdy transferred this issue from AMD-OSX/AMD_Vanilla Jun 27, 2020
@reaper69man
Copy link

reaper69man commented Jul 2, 2020

I'm also experiencing poor graphical performance on my newly built AMD 3950X Hackintosh with a Radeon VII when compared to my Intel 7980XE Hackintosh which also has a Radeon VII. The UI on the AMD system just doesn't feel quite as fluid and 3D performance is approx. 50% of my Intel System. Although, GPU compute performance between the two systems is comparable:

Geekbench (Metal): AMD - 103639 / Intel - 96146
Geekbench (OpenGL): AMD - 56890 / Intel - 82626
Luxmark: AMD - 50117 / Intel - 50117
Heaven (Extreme): AMD - 58.0fps / Intel - 116.7fps

I've also noticed the following error being logged very sporadically on the AMD system:

localhost kernel[0]: (IOAcceleratorFamily2) void IOAccelFenceMachine::fence_timeout(IOTimerEventSource *): AMDRadeonAccelerator prodding blockFenceInterrupt

@memegauste
Copy link

Yeah, and I want to note that FF XIV performance on my Windows boot is about 60 FPS on 4K maxed, and on Hackintosh it's 30FPS FullHD mid.

image

Some people were saying that I'm not running real mac and this is an cause, but I see this as some kind of misunderstanding. Basically Intel Hackintoshes /outperforms/ real Macs anyway and you can /game/ on them /easily/. Also you CAN'T notice 500% performance drop while using macOS on Ryzentosh, this is just unreal. The issue is somewhere in drivers, maybe 10.15.6 will fix the problem, but I don't have time to test beta 3 on my machine and then revert back. I don't know also if people tested Big Sur, and it's better or not.

Something is also different when running Hack in Proxmox VM, I suppose the issue is in kernel patches, or there is some difference beetwen native and VFIO passthrought support of Radeon.

@Pavo-IM
Copy link

Pavo-IM commented Sep 7, 2020

Just wanted to add here that the patch that is causing GPU performance issues is the Fix PAT kernel patch.

@tomnic79
Copy link
Author

tomnic79 commented Sep 8, 2020

Tried to disable the Fix Pat kernel patch as Pavo-IM suggested, my system booted without yellow screen, it's very slow in the GUI in the first three minutes but it boots, Cinebench OpenGL score went up to promox levels ( 130 fps vs 100 fps), in Minecraft also I get 300 fps, but I get horrible graphical glitches... I think that fixing mtrr_update_action in xnu for AMD is the key to solve the issue I've opened here

@tomnic79
Copy link
Author

tomnic79 commented Oct 20, 2020

As Pavo said, problem solved disabling the Fix Pat patch for TRX40 users, but for every other AMD user you just need to change the replace value of the Fix Pat patch as follows:

<data>uXcCAAC4BgYGBroGBgYGDzAPCQ==</data>

I've done a video with direct comparison with the old and the new patch: https://www.youtube.com/watch?v=6r-d4jgnc2E

@erenatas
Copy link

erenatas commented Nov 8, 2020

As Pavo said, problem solved disabling the Fix Pat patch for TRX40 users, but for every other AMD user you just need to change the replace value of the Fix Pat patch as follows:

<data>uXcCAAC4BgYGBroGBgYGDzAPCQ==</data>

I've done a video with direct comparison with the old and the new patch: https://www.youtube.com/watch?v=6r-d4jgnc2E

I'm currently giving this a shot. Geekbench 5 OpenCL went from 44k to 50k. Thanks!

I will put the Heaven benchmark results after changing to here if it helps.
MB: X570I Aorus Pro Wifi
CPU: 3950X
GPU: Radeon VII
Screenshot 2020-11-09 at 00 55 44

@aleixsr
Copy link

aleixsr commented Nov 17, 2020

Hello, this fix works like a charm!
What I find when I changed from "uXcCAAC4BgEHALoGAQcADx9AAA==" to "uXcCAAC4BgYGBroGBgYGDzAPCQ==" gived me x10 FPS!

But I found a cons: Sound output only on DisplayPort is "glitching", do you know why?

Thank you very much.

@tomnic79
Copy link
Author

It's a "secondary" bug with some configurations, try to open audio/midi utility and adjust sample rate / bit rate of DP audio

@aleixsr
Copy link

aleixsr commented Nov 18, 2020

Hi, I tried Audio MIDI Setup but it didn't help, do you have any idea?

@mame-erl
Copy link

As Pavo said, problem solved disabling the Fix Pat patch for TRX40 users, but for every other AMD user you just need to change the replace value of the Fix Pat patch as follows:

<data>uXcCAAC4BgYGBroGBgYGDzAPCQ==</data>

Can confirm this highly increasing 3D performance on my 10.15.7 / Ryzen 7 3700X / Sapphire RX5600XT Hackintosh. Thank you!

@aleixsr
Copy link

aleixsr commented Dec 21, 2020

Yes I can confirm competely.

@W-KE
Copy link

W-KE commented Mar 19, 2021

As Pavo said, problem solved disabling the Fix Pat patch for TRX40 users, but for every other AMD user you just need to change the replace value of the Fix Pat patch as follows:

<data>uXcCAAC4BgYGBroGBgYGDzAPCQ==</data>

I've done a video with direct comparison with the old and the new patch: https://www.youtube.com/watch?v=6r-d4jgnc2E

Confirmed fix working and no issue with DP audio after applying Shaneee - mtrr_update_action - fix PAT

Got around 25fps with algrey - mtrr_update_action - fix PAT and around 300fps with Shaneee - mtrr_update_action - fix PAT in Minecraft.

Should get Shaneee - mtrr_update_action - fix PAT [my default] : Full FPS on gaming but issues using HDMI/DP audio. according to this repo https://github.com/aleixsr/Ryzentosh.
But I haven't got any audio issue with DP.

Component Model
CPU AMD Ryzen 9 3900X
RAM 64GB (2 x 32GB) DDR4 @2666MHz CL16
Mobo ROG Strix X570-E Gaming
Graphics GIGABYTE Radeon™ RX 5700 XT 8G Reference
OC 0.6.3

rockofox added a commit to rockofox/Hackintosh-Ryzen-MSI-B450I that referenced this issue Jul 4, 2021
The previous value seemed to be for TRX40 users, changing to the correct value yields much better graphical performance.
AMD-OSX/bugtracker#5 (comment)

WARNING: This may break displayport, look at the issue for further info regarding the patch
portrayer pushed a commit to portrayer/Hackintosh-Ryzen-MSI-B450I that referenced this issue Jul 8, 2021
The previous value seemed to be for TRX40 users, changing to the correct value yields much better graphical performance.
AMD-OSX/bugtracker#5 (comment)

WARNING: This may break displayport, look at the issue for further info regarding the patch
@GabSan1212
Copy link

Hello, this fix works like a charm! What I find when I changed from "uXcCAAC4BgEHALoGAQcADx9AAA==" to "uXcCAAC4BgYGBroGBgYGDzAPCQ==" gived me x10 FPS!

But I found a cons: Sound output only on DisplayPort is "glitching", do you know why?

Thank you very much.

How u changed it?

@aleixsr
Copy link

aleixsr commented Feb 8, 2024

Hello, this fix works like a charm! What I find when I changed from "uXcCAAC4BgEHALoGAQcADx9AAA==" to "uXcCAAC4BgYGBroGBgYGDzAPCQ==" gived me x10 FPS!
But I found a cons: Sound output only on DisplayPort is "glitching", do you know why?
Thank you very much.

How u changed it?

Using ProperTree is the easyest way.

@GabSan1212
Copy link

Hello, this fix works like a charm! What I find when I changed from "uXcCAAC4BgEHALoGAQcADx9AAA==" to "uXcCAAC4BgYGBroGBgYGDzAPCQ==" gived me x10 FPS!
But I found a cons: Sound output only on DisplayPort is "glitching", do you know why?
Thank you very much.

How u changed it?

Using ProperTree is the easyest way.

image
what option I need to change here

@aleixsr
Copy link

aleixsr commented Feb 8, 2024

Change Enabled to True at #20 and Enabled to False at #21.

@GabSan1212
Copy link

Change Enabled to True at #20 and Enabled to False at #21.

Anything else?

@aleixsr
Copy link

aleixsr commented Feb 8, 2024

Change Enabled to True at #20 and Enabled to False at #21.

Anything else?

Restart and try :)

@GabSan1212
Copy link

Change Enabled to True at #20 and Enabled to False at #21.

Anything else?

Restart and try :)

When im playing minecraft (for example) i get like 60-80 unestable fps with this config, do you know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests