AS many ppl have trouble with instaling m.2 SSD on z170 motherboard i post short guide here, share it for everyone who need it .
Bellow method i used to instal Samsung SM 951 m.2 card on Asus Maximus VIII Hero z170


There is whats i did :

1st boot ( All other devices, and hdd disconected)
BIOS settings changed to :
Boot / CSM > DISABLED
PCIEX4_3 Slot(black) Bandwidth > Auto
additional options :
Advanced /PCH storage configuration >SATA mode selection > AHCI
Advanced /PCH storage configuration >Hyperkit mode > enabled

2th boot
Tools > secure erase SM951

3th boot
Tools > secure erase SM951 finish it

4th boot
Boot /Secure Boot - OS type >> Other OS
Boot /Secure Boot - Key Menegment - Install default secure boot keys ( and accept )
IMPORTANT !!!
After that connect USB stick with windows 7/8/10 or DVD with properly installation

5th boot
at this point system should boot from USB or DVD , and i you be able to create partition on SM951 +start installation process system
IMPORTANT next boot you need enter bios !!!

6th boot
setup BIOS - Boot /CSM - ENABLED
Boot device control - UEFI and legacy OPROM
Boot from storage devices - UEFI driver first
Boot from PCI-E /PCI extension devices - UEFI driver first
Boot /Secure Boot - OS type >> Windows with UEFI
additional options :
Advanced /PCH storage configuration >SATA mode selection > AHCI
Advanced /PCH storage configuration >Hyperkit mode > enabled
PCIEX4_3 Slot(black) Bandwidth > Auto

7th boot
continue windows instalation , after finish and reboot turn off PC, reconect other devices and HDD

8th boot
PCIEX4_3 Slot(black) Bandwidth > x4

all credits belong to RushKit and his https://www.youtube.com/watch?v=v7PEBscJbno guide