I'm not goot at english but chinese input has problem now,
so I use english to do some memo here for installing nvidia driver
on Dell Vostro 5470(GT740M) with ubuntu 14.04.
1.Install bumblebee:
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic
2.Modify /etc/bumblebee/bumblebee.conf
Indicate driver type and version number,
304 is ubuntu 14.04 default version of nvidia driver,
so replace "cuurrent" to "304":
sudo gedit /etc/bumblebee/bumblebee.conf
Driver=nvidia
KernelDriver=nvidia-304
LibraryPath=/usr/lib/nvidia-304:/usr/lib32/nvidia-304
XorgModulePath=/usr/lib/nvidia-304/xorg,/usr/lib/xorg/modules
3.Reinstall bbswitch-dkms:
sudo apt-get install --reinstall bbswitch-dkms
then reboot, if you can see login screen then that should be no problem.
but,
try to use dgpu by primusrun command,
it replied something like "can't access dgpu...",
check dmesg, that should be caused by nvidia-304 doesn't support GT740M what Vostro 5470 adpoted,
I tried steps on nvidia-331 what I did on ubuntu 13.10 but that caused some "black border" issue.
So,
4.Refered here to update nvidia driver to 346:
http://www.binarytides.com/install-nvidia-drivers-ubuntu-14-04/
Press Windows key then active "Additional Drivers",
click tab "Additional Drivers",
check "Using NVIDIA binary driver - version 346.82 from nvidia-346-updates(proprietary)",
then click "Apply Changes" and wait it accomplishes.
Once driver be updagted,
5.Config bumblebee again,
replace "304" to "346":
sudo gedit /etc/bumblebee/bumblebee.conf
Driver=nvidia
KernelDriver=nvidia-346
LibraryPath=/usr/lib/nvidia-346:/usr/lib32/nvidia-346
XorgModulePath=/usr/lib/nvidia-346/xorg,/usr/lib/xorg/modules
6.Reinstall bbswitch-dkms again:
sudo apt-get install --reinstall bbswitch-dkms
then reboot,
if you can see login screen then that should be no problem,
then test primusrun by something like glmark2:
vblank_mode=0 primusrun glmark2
glmark2 can be ran, performance looks like behavior of dgpu,
check lspci also can see pci device of nvidia,
and it's info wouldn't be ff during primusrun runnung,
so it works.
Installing nvidia driver is always so difficult part in using ubuntu,
fortunately informations can be got easily today by internet,
and thanks linux has dd, very convenient tool to do backup and recovery.