AMD-OSX / bugtracker

AMD OS X Bugtracker
13 stars 2 forks source link

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

Closed tomnic79 closed 4 years ago

tomnic79 commented 4 years ago

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 commented 4 years ago

try this: https://forums.macrumors.com/threads/tired-of-low-geekbench-scores-use-radeonboost.2231366/

tomnic79 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

...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>
PSzczepanski1996 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

PSzczepanski1996 commented 4 years ago

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.

reaper69man commented 4 years ago

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

PSzczepanski1996 commented 4 years ago

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 commented 4 years ago

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

tomnic79 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

aleixsr commented 4 years ago

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

mame-erl commented 3 years ago

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 commented 3 years ago

Yes I can confirm competely.

W-KE commented 3 years ago

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
GabSan1212 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

GabSan1212 commented 9 months ago

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

Anything else?

aleixsr commented 9 months ago

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

Anything else?

Restart and try :)

GabSan1212 commented 9 months ago

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?