Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

h9826790

macrumors P6
Original poster
Apr 3, 2014
16,656
8,587
Hong Kong
But VideoProc is not Apple software. If I understand the problem well, it is up to the developers of VideoProc to program their software so that it can use the full GPU potential in a Mac (Intel UHD graphics + discrete GPU).

If Apple not proving HWaccel at system level, 3rd party developers can do nothing about it.

For example, Apple and Nvidia don’t make RTX card work in MacOS at system level. VideoProc developer won’t be able to use the full potential of any RTX card.
 

PBMB

macrumors 6502
Mar 19, 2015
331
135
If Apple not proving HWaccel at system level, 3rd party developers can do nothing about it.
There exists video processing software that can use everything a Mac has inside. It is Apple's own Final Cut. So this would mean that Apple has not disclosed to independent developers how to program a discrete GPU. But Metal is not exactly about that? Or perhaps video processing does need more than Metal offers to developers?
 

h9826790

macrumors P6
Original poster
Apr 3, 2014
16,656
8,587
Hong Kong
There exists video processing software that can use everything a Mac has inside. It is Apple's own Final Cut. So this would mean that Apple has not disclosed to independent developers how to program a discrete GPU. But Metal is not exactly about that? Or perhaps video processing does need more than Metal offers to developers?

Metal has nothing to do about the hardware video engine.
 

donvito4ever

macrumors regular
Apr 9, 2016
116
13
Spain
OK, I found a way to enable hwaccel WITHOUT Lilu and WEG.
View attachment 841371

TBH, I don't think this is a better approach. More work to do, higher risk to damage the OS, harder to disable / revert. And I don't know how to enable DRM streaming in this way (Chromium base Netflix still works, but iTunes DRM streaming doesn't work).

But the advantage is, you may able to keep SIP fully enabled.

To achieve this, two files need to be edited.

Both hide inside the AppleGVA.framework

1) System⁩ ▸ ⁨Library⁩ ▸ ⁨PrivateFrameworks⁩ ▸ ⁨AppleGVA.framework⁩ ▸ ⁨Versions⁩ ▸ ⁨A⁩⁩ ▸ AppleGVA

2) System⁩ ▸ ⁨Library⁩ ▸ ⁨PrivateFrameworks⁩ ▸ ⁨AppleGVA.framework⁩ ▸ ⁨Versions⁩ ▸ ⁨A⁩ ▸ ⁨Resources⁩⁩ ▸ ⁨Info.plist

I won't go into too details step by step at this moment. Because this is a more danger approach IMO. And I couldn't find any real world difference then using board-id injection. HEVC encoding still can't be activated. I am not sure if this can give Polaris GPU more stable hwaccel support. I only confirm this can work 10min ago. I keep running FCPX and Compressor in the last 10min. No crash, no freeze. But I can't say this is a better way to RX580 users yet. Simply too little data to confirm anything.

However, for those who have knowledge / skill to edit these two files. You may try it if you wish.

1) Open the AppleGVA file by a Hex editor.

Replace BOTH iMac Pro's board-id by the cMP's board-id
View attachment 841376

2) Open Info.plist by text editor.

Replace the iMac Pro board-id by the cMP's board-id
View attachment 841378

Reboot. (REMOVE all Lilu, WEG, and boot arguments if applicable)

Then the cMP will also able to use hwaccel without Lilu and WEG.

I boot into another boot drive in order to mod this test drive's files. So that I don't have to copy the file to desktop etc, or fix permission. Just mod them directly (because they were not a part of the OS when I mod them).

Anyway, do NOT do this if you have any doubt. It is definitely NOT for any normal users, or daily use at this moment.

P.S. you may need to run the following command after editing the AppleGVA file
Code:
sudo codesign -f -s - /System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A/AppleGVA


Update 1: Did lots of tests in the last 10 hours. Result shows perfectly stable for my RX580. Here is the a quick 5min capture of FCPX stability test (as always, please use Chromium base browser and watch the video in 4K. Otherwise, hard to see the details). This may become the solution for those Polaris GPU users that having system freeze issue.

Another short video which playback 5 different HEVC / H264 video in FCP timeline simultaneously. Please ignore that little choppy playback. That's because the GPU have to record the screen as well. This is more for stability test, not performance test. I did the test for much longer, but just record few minutes to shows how I did that.

I also intentionally destroy the AppleGVA file and see what will happen. Mojave can always boot to desktop. So, it seems this approach is quite safe, and easy to fix / recovery if the user did something wrong.

For stability / stress tests, I ran the above test a few times. And few more with Compressor encoding 3 videos simultaneously in the background + Luxmark + Unigine Heaven (Extreme Preset). And one of the test I even login to another profile and doing more video encoding in the background (multi profile logged in). Of course, the screen capture also done via hwaccel as well. Not a single freeze, crash, glitch yet.

If any Polaris user can tell me a reproducible way to get into that GPU Restart event (when using the Lilu / WEG method). Please let me know. I can do the stability test for this hex edit method.

Please, can you link it in the first post?
 

SnakeCoils

macrumors regular
Oct 17, 2018
133
60
Italy
I can confirm the H264 hardware encoding and H265 decoding works flawlessy with hex edit method also in my brand new MSI RX560 4 Gb, as test file I have converted the demo Sony Aquarium from UHD video/H265 to HD/H264 using the x264 and VideoToolbox versions: 17 fps on a single X5690 (RAM 12 Gb 1333 Mhz), 25 fps on the RX560 (4 Gb).
Not bad at all :)
 

h9826790

macrumors P6
Original poster
Apr 3, 2014
16,656
8,587
Hong Kong
I can confirm the H264 hardware encoding and H265 decoding works flawlessy with hex edit method also in my brand new MSI RX560 4 Gb, as test file I have converted the demo Sony Aquarium from UHD video/H265 to HD/H264 using the x264 and VideoToolbox versions: 17 fps on a single X5690 (RAM 12 Gb 1333 Mhz), 25 fps on the RX560 (4 Gb).
Not bad at all :)

Thanks, you just remind me that I can make a performance comparison of the RX580 and Radeon VII (of course, about the HWAccel performance, but not gaming, etc).

Both done on my cMP, same CPU, same RAM, same SSD, just the GPU is upgrade, and Mojave minor update.

Both tests convert the same Sony HEVC 4K video to H264, with the same command in FFMpeg
Code:
FFmpeg -hwaccel videotoolbox -i HEVC.mp4 -b:v 16000k -c:v  h264_videotoolbox  H264.mkv

For RX580, 24FPS
RX580 - HEVC to H264 hwaccel.png


For Radeon VII, 55FPS
Radeon VII - HEVC to H264 full HWAccel.png
 

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
Nice, too bad the Radeon VII is so expensive. Not worth the extra $$ for my usage, but good to know it's so powerful.

@h9826790
Okay, so I did the Alternate method and downloaded the trial VideoProc app. My GPU is Sapphire Radeon Pulse RX580...

VideoProc says Acceleration is enabled for h264 but unavailable for HEVC. Is that normal for my GPU?

Now Safari plays Netflix again instead of previous HTML5 / Silverlight error. It starts with video, screen goes solid RED, and audio keeps playing. If you move the scrubber on the bottom, the position locater displays small video frames as you rollover. Too bad it doesn't fix that altogether... At least I know it did something.
 
Last edited:

octoviaa

macrumors regular
Oct 19, 2013
172
88
Nice, too bad the Radeon VII is so expensive. Not worth the extra $$ for my usage, but good to know it's so powerful.

@h9826790
Okay, so I did the Alternate method and downloaded the trial VideoProc app. My GPU is Sapphire Radeon Pulse RX580...

VideoProc says Acceleration is enabled for h264 but unavailable for HEVC. Is that normal for my GPU?

Now Safari plays Netflix again instead of previous HTML5 / Silverlight error. It starts with video, screen goes solid RED, and audio keeps playing. If you move the scrubber on the bottom, the position locater displays small video frames as you rollover. Too bad it doesn't fix that altogether... At least I know it did something.
VideoProc shows no HEVC is normal: #397 (but you should have decode acceleration)

You can test with "sword-smith" video to test HEVC decode acceleration (encode never work).
 
  • Like
Reactions: h9826790

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
Just ran the “jellyfish video”. Couldn’t really play it at all without the HW Acceleration mod, now with the “alternate method” it plays smooth as silk in every app I try. Monumental difference. A permanent alteration for me now. Running this on my primary install.

I’ll look for that swordsmith video tomorrow and have a run at it.

EDIT:
Okay, so I just did the swordsmith video and DAMN! That thing is nice. How in the world could Apple justify denying us cMP owners the benefit of Hardware Acceleration since it's easily available. Wow!
 
Last edited:

Kevbasscat

macrumors 6502
Oct 10, 2016
255
180
Banning, CA 92220
Ok, real rookie, dummy question. Does this work on say a mid 2017, 27" 5k i'Mac with 3.8 GHz i5, and a Radeon Pro 580, or is this just for the Mac Pros? I REALLY don't want to have to sell this and buy the 2019 iMac, but if I won't be able to run the new formats, why keep it? It's already "vintage" in my eyes. S**t! I just learned this past couple months anything earlier than the 2018 Macs can't process it. Or is there a workaround in the works? You guys are awesome, this whole thread. I feel terrible because I made a deal to buy a 5,1 dual tray, 2xX5690's, 96gb ram Radeon Sapphire Pulse 580 & 2 other GPU's. Got sick and flaked, sadly. So I'm feelin' the envy, if that makes sense. I looked but didn't see anything about this on my thread. Any advice would be appreciated. Thank you.
 

h9826790

macrumors P6
Original poster
Apr 3, 2014
16,656
8,587
Hong Kong
Ok, real rookie, dummy question. Does this work on say a mid 2017, 27" 5k i'Mac with 3.8 GHz i5, and a Radeon Pro 580, or is this just for the Mac Pros? I REALLY don't want to have to sell this and buy the 2019 iMac, but if I won't be able to run the new formats, why keep it? It's already "vintage" in my eyes. S**t! I just learned this past couple months anything earlier than the 2018 Macs can't process it. Or is there a workaround in the works? You guys are awesome, this whole thread. I feel terrible because I made a deal to buy a 5,1 dual tray, 2xX5690's, 96gb ram Radeon Sapphire Pulse 580 & 2 other GPU's. Got sick and flaked, sadly. So I'm feelin' the envy, if that makes sense. I looked but didn't see anything about this on my thread. Any advice would be appreciated. Thank you.

Your iMac has QuickSync, doesn't need this mod.
 

cdf

macrumors 68020
Jul 27, 2012
2,256
2,583
Now Safari plays Netflix again instead of previous HTML5 / Silverlight error. It starts with video, screen goes solid RED, and audio keeps playing. If you move the scrubber on the bottom, the position locater displays small video frames as you rollover. Too bad it doesn't fix that altogether... At least I know it did something.

Nice to finally hear that there could be some hope for Netflix on Safari! Any ideas why the video doesn't stick?
 

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
Nice to finally hear that there could be some hope for Netflix on Safari! Any ideas why the video doesn't stick?

None at all. I was very surprised.

On a related note, a long tine ago I purchased a media streaming app called Friendly Streaming. It stopped working the same time that Safari/Silverlight stopped working. After doing the Hardware Accel Mod, the app (Friendly Streaming) now works with Netflix again. This was a welcomed (even if no longer needed) surprise.

I can only guess that Apple when out of their way to break Netflix/Safari compatibility.
 
Last edited:
  • Like
Reactions: foliovision

kmac1036

macrumors newbie
Sep 6, 2019
3
0
None at all. I was very surprised.

On a related note, a long tine ago I purchased a media streaming app called Friendly Streaming. It stopped working the same time that Safari/Silverlight stopped working. After doing the Hardware Accel Mod, the app (Friendly Streaming) now works with Netflix again. This was a welcomed (even if no longer needed) surprise.

I can only guess that Apple when out of their way to break Netflix/Safari compatibility.

IMO they didn't per se, Microsoft is phasing out Silverlight & has ended support on the Mac already. Apple released Safari 12, which deprecated Silverlight... So now HTML5 video in Safari is hardware accelerated, up to 1080p, while the other browsers are software only & only 720p to boot. The reason for the cutoff in hardware HTML5 support is Intel QuickSync, which only exists in Sandy Bridge or later i-Series processors. So anything that's Core series or Xeons, even with this card and mod, will probably not work. I'm guessing they're forcing QSV somehow, either in VideoToolbox or another framework.

I tried @h9826790 Alt mod and I think I got it working! So many thanks for posting this! Bought a used RX560 from eBay. Think I finally got Plex to use it for at least h264 stuff as well. Did the full jump to Mojave 10.14.6 & this mod last night, so I'm hoping this gets me through until I plan out and can buy another machine at some point.
 
Last edited:

kmac1036

macrumors newbie
Sep 6, 2019
3
0
Got the MOD working, or got the MOD/Netflix working. Please clarify.

The mod itself. Have not tried netflix nor do I think we'd have a fix for that on the cMP unfortunately.

EDIT: May have dug up something to tweak Chrome, will report back later when I have a chance to try at home.
 

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
Google Chrome works fine on Netflix at 720p, Friendly Streaming App started working again after the Mod (720p).


Firefox stopped working with Netflix. Googling the UI3012 error code, it seems to be a Networking problem. So rebooting, and confirming a proper network connection resolved nothing. Chrome and Friendly Streaming still working properly.

Firefox 2019-09-06 at 3.06.38 PM.png
 
Last edited:
  • Like
Reactions: handheldgames

Ludacrisvp

macrumors 6502a
May 14, 2008
797
363
So here’s an interesting twist.
On my 3,1 I noticed it wasn’t working anymore with the RX 580. Tried doing the hex edit method (using the 3,1 board ID) and still nothing. Rebooted into a different install of Mojave and it worked fine there. Removed the hex edit method on original install and copied over the needed bits from the second install and it still didn’t work.

On a whim I logged in with a different user on the 3,1 and it worked perfectly again for both 264 and hevc (decode only). Logged out of that user and back to original user and it was broken again. Switched users again and it worked. (No reboots between user switching)

So there appears to be something in the user profile that can break / prevent this from working. Therefore it may be a good idea to add this as a troubleshooting step.
 
  • Like
Reactions: VaZ
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.