Contribute
Register

Z170X-UD5 TH High Sierra tips and tricks

Status
Not open for further replies.
Joined
Sep 22, 2016
Messages
464
Motherboard
Gigabyte Z170X-UD5 TH-Clover
CPU
i7-6700K
Graphics
Vega 56
Mac
  1. Mac mini
Mobile Phone
  1. iOS
Gigabyte Z170X-UD5 TH motherboard

I decided to create a thread for Gigabyte Z170X-UD5 TH motherboard users. This motherboard comes with Thunderbolt support, which is great for building custom macOS computer. Gigabyte claims that Z170X-UD5 TH is World's First Intel® Thunderbolt™ 3 Certified Motherboard. Board supports Supports 7th / 6th Generation Intel® Core™ Processors and up to 64 GB of system memory. It's great board for video and photo production. There is no many thunderbolt built in alternatives available.

There are multiple threads how to install hackintosh on Z170X-UD5 TH. I'm not going to repeat any of these. The most complicated part is to build a comp that runs smoothly without issues.

My hack is based on Z170X-UD5 TH (Intel® Z170 Chipset) motherboard, i7-6700K (4,01 GHz) Intel Core i7 processor and NVIDIA GeForce GTX 970 4GB graphics card.

I'm going to update this post to share my configuration, problems etc. You are welcome to post to share your thoughts and and success.

macOS Mojave 10.14.* and NVIDIA graphics
I'm unable to upgrade my hack from macOS High Sierra to Mojave because of NVIDIA graphics card. Maybe I'm going to replace my card with an AMD card, but not sure yet. If NVIDIA will not provide drivers within next 4 months, I'm probably switching to AMD card (AMD Radeon RX Vega 64). Apple states that only specific cards will work on Mojave:

These specific third-party graphics cards are Metal-capable and compatible with macOS Mojave on Mac Pro (Mid 2010) and Mac Pro (Mid 2012):
  • MSI Gaming Radeon RX 560 128-bit 4GB GDRR5
  • SAPPHIRE Radeon PULSE RX 580 8GB GDDR5
  • SAPPHIRE Radeon HD 7950 Mac Edition
  • NVIDIA Quadro K5000 for Mac
  • NVIDIA GeForce GTX 680 Mac Edition
Some other third-party graphics cards* based on the following AMD GPU families might also be compatible with macOS Mojave on Mac Pro (Mid 2010) and Mac Pro (Mid 2012):
  • AMD Radeon RX 560
  • AMD Radeon RX 570
  • AMD Radeon RX 580
  • AMD Radeon Pro WX 7100
  • AMD Radeon RX Vega 56
  • AMD Radeon RX Vega 64
  • AMD Radeon Pro WX 9100
  • AMD Radeon Frontier Edition

As I'm stuck on High Sierra, this thread is mainly about High Sierra. Of course your post about success/failure with Mojave are welcome.

Firmware (BIOS)
I'm using the latest firmware of Z170X-UD5 TH, version F22g, released on 2018/03/09. Suggestions about the best BIOS settings are welcome!

CFG Lock setting
On Z170X-UD5 TH BIOS the CFG Lock setting is hidden and by default it's disabled, which causes kernel panic. To overcome this we use KernelPM patch in Clover settings. There a way how to patch BIOS so default value for CFG Lock setting will be enabled.

KernelPm patch on Glover is needed for any system that uses XCPM and has MSR_PKG_CST_CONFIG_CONTROL locked.

Starting with Haswell Macs, CPU power management functionality was moved into the kernel (known as XNU CPU Power Management). KernelPm patches the kernel to prevent writes to MSR_PKG_CST_CONFIG_CONTROL (MSR 0xE2), which is frequently locked on many systems (can usually be disabled by disabling the firmware option "CFG Lock"). Without this patch, you will encounter a kernel panic if MSR 0xE2 is locked (which appears to be the case for your system).

Using patched BIOS eliminates need for KernelPm patch. With this patch is possible to get fully native HWP (Intel SpeedShift Technology) CPU Power Management for all Skylake-X processors on all X299 mainboards with unlocked MSR 0xE2 BIOS Register, resulting in absolutely brilliant and top-end CPU performance.

Please read detailed instructions here:
On Z170X-UD5 TH BIOS version f22g the CFG Lock offset is 0x4EF and 0x1 is default setting.

Command to use with modified GRUB Shell for motherboard Z170X-UD5 TH BIOS version f22g:

Code:
setup_var 0x4EF 0x00

Screenshots of BIOS settings

DSC00001.jpg DSC00002.jpg DSC00003.jpg DSC00004.jpg DSC00005.jpg DSC00006.jpg DSC00007.jpg DSC00008.jpg DSC00009.jpg DSC00010.jpg DSC00011.jpg DSC00012.jpg DSC00013.jpg DSC00014.jpg DSC00015.jpg DSC00016.jpg DSC00017.jpg DSC00018.jpg DSC00019.jpg DSC00020.jpg DSC00021.jpg DSC00022.jpg DSC00023.jpg DSC00024.jpg DSC00025.jpg DSC00026.jpg


Clover configuration
Crucial part of hackintosh are clover drivers, it's configuration and additional kexts. I'm sharing screenshots of my clover configuration with you, so you can make better suggestions or use these to try.

clover-configuration-001.jpg clover-configuration-002.jpg clover-configuration-003.jpg clover-configuration-004.jpg clover-configuration-005.jpg clover-configuration-006.jpg clover-configuration-007.jpg clover-configuration-008.jpg clover-configuration-009.jpg clover-configuration-010.jpg clover-configuration-011.jpg clover-configuration-012.jpg clover-configuration-013.jpg

List of kexts on /EFI/EFI/CLover/kexts/Other
AML files on /Volumes/EFI/EFI/CLOVER/ACPI/patched
  • SSDT-HDMI-HD530.aml
  • SSDT-HDMI-NVIDIA-PEG0.aml
  • SSDT.aml
See attachments below to download these files. (aml-files.zip)

VirtualSMC
VirtualSMC supersedes FakeSMC.kext. It's quite new and there is no much information available yet. To use it, you shall remove FakeSMC.kext and all its plugins like FakeSMC_ACPISensors.kext etc. You can download it here VirtualSMC releases. Haven't tested it yet. FAQ of VirtualSMC states about benefits:

Depending on the circumstances VirtualSMC can bring better compatibility with present and future macOS releases providing broader SMC feature support and allowing more flexible SMC key emulation like MMIO, events (like in SMCLightSensor), permission support, etc. On older Macs it can be used to upgrade SMC generation with more features.

About requirements FAQ states:

Compatible Lilu is required for full functionality, basic functionality will be available even on beta macOS versions or with -liluoff boot-arg. VirtualSMC.efi module is recommended for boot.efi compatibility when FileVault 2 is enabled. SMCHelper-64.efi is not compatible with VirtualSMC.efi and must be removed.

If you keen to test new things, it's for you. If you aren't quite familiar building hack, FakeSMC.kext might be better option as there is lot of info world-wide available.

Audio
Use AppleALC.kext and CodecCommander.kext.
Modify CodecCommander.kext/Contents/Info.plist IOKitPersonalities/CodecCommander/Codec Profile/Realtek ALC1150
  • Send Delay = 300
  • Sleep Nodes = false
  • Update Nodes = true
USB Fix
Fix USB after 10.13.6 update:
  • Click Kernel and Kext Patches on Clover Configurator
  • remove/disable previous com.apple.driver.usb.AppleUSBXHCI patches.
  • Click the “+” button near the bottom to add this patch:
  • Name*: com.apple.driver.usb.AppleUSBXHCI
  • Find* [HEX]: 837D880F 0F83A704 0000
  • Replace* [HEX]: 837D880F 90909090 9090
  • Comment: USB 10.13.6+ by PMHeart
  • MatchOS: 10.13.x
  • Save config.plist
Native USB
Thanks to USBInjectAll.kext and OSX-USB-SSDT is possible to create "native" USB for Z170X-UD5 TH. No need after that to use USBInjectAll.kext. Also it helps easily to disable desired ports. I created separate extremely detailed post about that on this thread:
port-mapping-01.jpg

You have to map all ports with USBInjectAll.kext, figure out which to exclude and then to run OSX-USB-SSDT script, which helps to generate proper SSDT-USB.aml file. After coping SSDT-USB.aml into /Volumes/EFI/EFI/CLOVER/ACPI/patched
folder, USBInjectAll.kext can be removed. Additional setting is required too in clover configuration too.

It's reccomended to decrease amount of USB ports to 15 or less ports, so you don't need port limit patch anymore. For example you can disable USB2 ports, which are shared with USB3 ports and internal ports, which doesn't have front panel brackets connected.

Useful Instructions

[will update soon]
 

Attachments

  • aml-files.zip
    2.1 KB · Views: 682
Last edited:
Ive also included a snapshot of my clover folder. I am using AppleALC with codec set to 1. No codec commander. With the drivers in the drivers64UEFI folder I use the native apfs.efi. no need to load in clover



Screen Shot 2018-11-11 at 4.59.41 PM.png
 

Attachments

  • Z170 Motherboard usb port map.pdf
    81.8 KB · Views: 416
  • Gigabyyte GA-Z170X-UD5 TH ports.pdf
    300.3 KB · Views: 422
  • USB-SSDT.aml
    10.9 KB · Views: 549
Just upgraded to 10.14.1 without issue except USB 3.0. Port limit patch broke so I lost some 3.0 ports. Fixed by using only 14 ports by eliminating 2 USB 2.0 ports (which I rarely use anyway) and a custom SSDT for port mapping. TB3 works as does USB c ports. Sleep, etc.

Have you got all USB ports working now?
 
How to create SSDT-USB.aml for native USB

Please note that you can use alternatively the Hackintool to create USB ports SSDT, but you need to know which name for which port correlates.

I have set a goal to create SSDT for native USB. I have seen several USB SSDT files for Gigabyte Z170X-UD5 TH, seems that all these are different. So, I'm trying to create my own SSDT for native USB. For first I will try collect all various USB SSDT files for Gigabyte Z170X-UD5 TH available on the Internet and when I'm done with my USB SSDT files, I can compare these with my own. Also I'm going to share all these, so other Gigabyte Z170X-UD5 TH owners can test those as well.

ga-z170X-ud5-th-board.jpg

Related sources:

Attached USB SSDT files & MD5's:
  • SSDT-USB-GA-Z170X-UD5-TH-by-apple-pic.aml = ec0ed2b10874477c78ad45471cf91b54
  • SSDT-USB-GA-Z170X-UD5-TH-by-lsp.aml = 72251f615898032ff693b651080ea499
  • SSDT-USB-GA-Z170X-UD5-TH-by-unknown.aml = 92a5224d7380ceb61e590273de5de7b6
SSDT-USB-GA-Z170X-UD5-TH-by-apple-pic.aml and SSDT-USB-GA-Z170X-UD5-TH-by-unknown.aml for usage with USBInjectAll.kext. SSDT-USB-GA-Z170X-UD5-TH-by-apple-pic.aml is for native USB without USBInjectAll.kext.

Attached archive contains also disassembled ASL file for each USB-SSDT file.

SSDT-USB-GA-Z170X-UD5-TH-by-apple-pic.aml and SSDT-USB-GA-Z170X-UD5-TH-by-unknown.aml are quite similar, except that in SSDT-USB-GA-Z170X-UD5-TH-by-apple-pic.aml are some ports excluded (HS05, HS06, HS09, SS05 and SS06 are exluded). You can read about excluding these port on apple-pic's post.

SSDT-USB-GA-Z170X-UD5-TH-by-lsp.aml is totally different from the rest (same order as above).

Code:
DefinitionBlock ("", "SSDT", 2, "hack", "UIAC-ALL", 0x00000000)

Code:
DefinitionBlock ("", "SSDT", 2, "INTEL", "xh_rvp10", 0x00000000)

Code:
DefinitionBlock ("", "SSDT", 1, "sample", "USBFix", 0x00003000)

USB ports on motherboard

mb-usb-ports-locations.jpg

Images with GA-Z170X-UD5-TH USB ports mapping. (I'm not sure how accurate those are).

181112-0002.jpg

apple-pic-ports-map-image.jpg

Procedure (Please post corrections, if I'm wrong)
  • Download latest OSX-USB-SSDT and extract.
  • Remove all USB-SSDT.aml patches from Clover EFI.
  • Add latest USBInjectAll.kext into Clover kexts folder.
  • Open Clover config file.
  • Add USB fix (Fix is for 10.13.6):
    • Click Kernel and Kext Patches on Clover Configurator
    • remove/disable previous com.apple.driver.usb.AppleUSBXHCI patches.
    • Click the “+” button near the bottom to add this patch:
    • Name*: com.apple.driver.usb.AppleUSBXHCI
    • Find* [HEX]: 837D880F 0F83A704 0000
    • Replace* [HEX]: 837D880F 90909090 9090
    • Comment: USB 10.13.6+ by PMHeart
    • MatchOS: 10.13.x
    • Save config.plist
  • Reboot.
  • Check that USB ports are working.
  • Make sure, wich ports you are using and what kind ports these are. (Enable? Internal? USB3?)
  • Run USB-SSDT.command on Terminal.
  • Answer all questions about all ports, (an examaple)
    • Do you want to enable: HS01? [Y/n]
    • You enabled: HS01, are you using it as an internally connected port (For example WiFi/Bluetooth module)? [y/N]
    • Is: HS01 a USB 3.0 connector? [Y/n]
  • Add generated SSDT-USB.aml into /Volumes/EFI/EFI/CLOVER/ACPI/patched folder.
  • Add xh_rvp10 setting into Clover DropTables section (instructions below)
  • Remove USBInjectAll.kext.
  • Reboot.
  • Check that USB ports are working.
USBInjectAll.kext ports 100-series chipset:
  • XHC, 100-series chipset (8086:a12f): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2)
  • XHC, 100-series chipset (8086:9d2f): 10-USB2 ports HS01-HS10, 6-USB3 ports SS01-SS06, plus USR1/USR2)
Gigabyte Z170X-UD5 TH USB specification:

Chipset+Intel® Thunderbolt™ 3 Controller:
  1. 2 x USB Type-C™ ports on the back panel, with USB 3.1 support
Chipset:
  1. 8 x USB 3.0/2.0 ports (4 ports on the back panel, 4 ports available through the internal USB headers)
  2. 5 x USB 2.0/1.1 ports (4 ports on the back panel, 1 port available through the internal USB header)
Chipset+GENESYS LOGIC USB 2.0 Hub:
  1. 3 x USB 2.0/1.1 ports available through the internal USB headers
List of ports (USBInjectAll.kext)

According to the Gigabyte Z170X-UD5 TH documentation this board should have
  • 10x USB3ports
    • 8x USB 3.0
      • 4x external
      • 4x internal
    • 2x USB 3.1 (external, USB-C)
  • 16x USB2ports
    • 8x external
    • 8x internal
Below are listed USB ports detected with USBInjectAll.kext.
  • External(Back Panel)
    • USB3(4 ports)
      • SS01 - <11 00 00 00> / 0x15100000 - blue bottom left (R_USB30_2)
      • SS02 - <12 00 00 00> / 0x15200000 - blue bottom right (R_USB30_2)
      • SS03 - <13 00 00 00> / 0x15300000 - blue top left (R_USB30_1)
      • SS04 - <14 00 00 00> / 0x15400000 - blue top right(R_USB30_1)
    • USB3.1(2 ports, also Thunderbolt 3 ports)
      • SS09 - <19 00 00 00> / 0x15900000 - USB-C port bottom (TYPEC_2)
      • SS10 - <1a 00 00 00> / 0x15a00000 - USB-C port top (TYPEC_1)
    • USB2(8 ports)
      • HS01 - <01 00 00 00> / 0x14100000 - blue bottom left (R_USB30_2)
      • HS02- <02 00 00 00> / 0x14200000 - blue bottom right (R_USB30_2)
      • HS03- <03 00 00 00> / 0x14300000 -blue top left (R_USB30_1)
      • HS04- <04 00 00 00> / 0x14400000 - blue top right (R_USB30_1)
      • HS11 - <0b 00 00 00> / 0x14b00000 - black bottom left (USB_LAN)
      • HS12 - <0c 00 00 00> / 0x14c00000 - black bottom right (USB_LAN)
      • HS13 - <0d 00 00 00> / 0x14d00000 - black top right (KB_MS_USB)
      • HS14 - <0e 00 00 00> / 0x14e00000 - black top left(KB_MS_USB)

  • Internal(Front Panel)
    • USB3(4 ports)
      • SS05 - <15 00 00 00> / 0x15500000 - internal top top (F_USB30_1)
      • SS06 - <16 00 00 00> / 0x15600000 - internal top top (F_USB30_1)
      • SS07 - <17 00 00 00> / 0x15700000 - internal top bottom (F_USB30_2)
      • SS08 - <18 00 00 00> / 0x15800000 - internal top bottom (F_USB30_2)
    • USB2(8 ports)
      • HS05 - <05 00 00 00> / 0x14500000 - internal top top (F_USB30_1)
      • HS06 - <06 00 00 00> / 0x14600000 - internal top top (F_USB30_1)
      • HS07- <07 00 00 00> / 0x14700000 - internal top bottom (F_USB30_2)
      • HS08- <08 00 00 00> / 0x14800000 - internal top bottom (F_USB30_2)
      • HS09- <09 00 00 00> / 0x14900000 - internal bottom left (F_USB1)
      • HS10 - <0a 00 00 00> / 0x14a00000 - internal bottom left & right (F_USB1/F_USB2)
        • Genesys Logic USB 2.0 Hub, 3 ports are shared between F_USB1 & F_USB2

  • Unknown (Where? Unused?)
    • USR1 - <0f 00 00 00> / 0x14f00000
    • USR2 - <10 00 00 00> / 0x15000000
Diagram of ports detected with USBInjectAll.kext:

port-mapping-01.jpg

How to decrease amount of ports?

All together 24 actual ports are used. To decrease amount of ports, some of them can be excluded. There are 2 internal front panel USB headers unused, on my case R_USB30_2 and F_USB1. Also USB2 ports on blue USB3 ports can be excluded.
  • All USB2 ports on R_USB30_1 and R_USB30_2 (4 ports)
  • All USB2 ports on F_USB30_1 (2 ports)
  • All USB2 ports on F_USB30_2 (2 ports)
  • ALL USB3 ports on F_USB30_2 (2 ports)
This will help to decrease amount of ports by 10.

3 ports are shared between F_USB1 & F_USB2, which means HS10 & HS09. If to put front panel USB racket into F_USB1 header instead of F_USB2, then port HS09 can be excluded too, which gives in total 9 ports to exclude.

After decreasing ports by 11 of them, we have 13 ports left. (24 - 11 = 13).

Ports which can be excluded:
  1. HS01 - USB2 shared with back panel USB3 port SS01.
  2. HS02 - USB2 shared with back panel USB3 port...
  3. HS03 - USB2 shared with back panel USB3 port...
  4. HS04 - USB2 shared with back panel USB3 port...
  5. HS05 - USB2 shared with front panel USB3 port SS05.
  6. HS06 - USB2 shared with front panel USB3 port...
  7. HS07 - Unused front panel USB2 (shared with front panel USB3 port SS07).
  8. HS08 - Unused front panel USB2 (shared with front panel USB3 port SS08).
  9. HS09 - Unused front panel USB2 (f the USB2 front panel bracket is in F_USB1 header).
  10. SS07 - Unused front panel USB3.
  11. SS08 - Unused front panel USB3.
SSDT-USB
Version 1.0.0, all ports are enabled
  • SSDT-USB-GA-Z170X-UD5-TH-by-ilikehackintosh.aml
To use this AML file, in Clover config section DropTables, this setting below is needed:
Code:
<array>
   <dict>
       <key>Signature</key>
       <string>SSDT</string>
       <key>TableId</key>
       <string>xh_rvp10</string>
   </dict>
</array>

181113-0001.jpg

Tested and works fine.
 

Attachments

  • SSDT-USB-GA-Z170X-UD5-TH.zip
    8 KB · Views: 447
  • SSDT-USB-GA-Z170X-UD5-TH-by-ilikehackintosh.aml
    11 KB · Views: 527
Last edited:
Thanks for posting the link. Thats what I used to create my custom ssdt. Howevver since the Port limit patch doesn’t work in Mojave and USBinjectall doesnt work without it, you need to boot into high sierra create your patch and then insert that into your Mojave EFI. All works well that way
you don't need a port limit patch to create the SSDT
 
Thanks for posting the link. Thats what I used to create my custom ssdt. Howevver since the Port limit patch doesn’t work in Mojave and USBinjectall doesnt work without it, you need to boot into high sierra create your patch and then insert that into your Mojave EFI. All works well that way

I haven't upgraded to Mojave, as it doesn't support my NVIDIA graphics card at the moment.
 
Status
Not open for further replies.
Back
Top