Hi there,

First things first, clean up the NIVIDA drivers already installed. I've added sudo for if you are a regular user

sudo ./NVIDIA-Linux-x86_64-340.65.run --uninstall

The command you linked above does not have the double - before the dkms flag. Use this below

./NVIDIA-Linux-x86_64-340.65.run --dkms -z

You don't touch the xorg.conf file at all. You don't need it and generating one under NVIDIA will break your install.

While I'm a huge fan of blackmoreops and his guides, you should not just follow them if you don't know what they are doing.

For example, his guide on NVIDIA is not for optimus platforms and it will break your install.

The easiest way would be to do a fresh install (as I don't know what you have done to your system) and then follow my guide from the start.

It would also be good to see the log here:

/var/lib/dkms/nvidia/340.65/build/make.log