Then I run VNC server and started a new remmote session.
I go to Applications > System tools > Administration > NVIDIA X Server Settings
And it says: “You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run nvidia-xconfig as root), and restart the X server”
Using X configuration file: “/etc/X11/xorg.conf”.
Backed up file ‘/etc/X11/xorg.conf’ as ‘/etc/X11/xorg.conf.backup’
New X configuration file written to ‘/etc/X11/xorg.conf’
sudo lightdm start
vncserver :7 -depth 24 -localhost
But the problem remains: “You do not appear to be using the NVIDIA X driver…”
After that, I entered via ssh and installed cuda-7 and 346 drivers
> sudo dpkg -i cuda-repo-ubuntu1404_7.0-28_amd64.deb
There would be no reason to set all your environment variables as if you had CUDA 6.5:
I have set related variables via /etc/environment
CUDA_HOME=/usr/local/cuda-6.5
Anyway, the X-server thing is probably an interaction with the use of VNC. The setup steps you have shown are probably not enough to properly establish a remote desktop that is GPU-X-accelerated.
If you want to verify the CUDA installation, try running nvidia-smi and also try running one or more CUDA samples, as discussed in the linux getting started guide: