I tried one more time. Tried your oc.sh - the same errors.
I can't set clock or fan speed. The same errors.
Via Nvidia X Server Settings I also can't to set clocks or fans speed. Just read, or set PowerMizer profile. Is it ok?
Maybe special configuration of MB bios? Maybe I must disable internal GPU and use NVIDIA?
I tried to view available clocks via nvidia-smi and see that it is N/A. Is it normal?
I am using MSI GTX1070 8G Gaming X. Maybe I need to flash some "unlocked bios" to change clocks?
I use 3x Asus Dual X 8GB OC version gtx 1070 and MSI 1070gtx gaming X
My all cards work and i can OC them. I can put memory offsets and core offsets. I have ubuntu 16.04
It all worked after i did 4 lines of code:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-370 nvidia-cuda-toolkit
sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration
Altough i eventualy added newer drivers for nvidia and did some updates, but it worked like this also.