1 - Boot Single User (press Command + S) at boot (If you have MacOS installed on your hard drive).
2 - If you have a blank HD, then use the USB stick/Pendrive with the MacOS installer (El Capitan, Sierra or HighSierra).
2.1 - Press Option key at boot, Position the mouse on the MacOS installer icon.
2.2 - Press Command + S and keep holding these two keys.
2.3 - Click the MacOS installer icon -> continue holding the Command + S keys until you finish the MacOS installer Single User boot .
Enter these commands (change gpu-power-prefs to Intel GPU and boot verbose):
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 nvram boot-args="-v"
You can read the complete post here:
It's long and take time Good luck