Monday, 3 June 2013

HOW-TO install the latest nvidia 319.23 drivers

After spending a lot of time trying to figure this out, I could finally make it without HDMI external output connected. The original Nvidia documentation needs to be tweaked for the 319.23 to actually work (intel instead of modesetting driver + autologin)

Install kernel 3.9


Download the latest 3.9 kernel files from the mainline and put them in a same folder :

http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-raring/linux-headers-3.9.0-030900-generic_3.9.0-030900.201304291257_amd64.deb
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-raring/linux-headers-3.9.0-030900_3.9.0-030900.201304291257_all.deb
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-raring/linux-image-3.9.0-030900-generic_3.9.0-030900.201304291257_amd64.deb

sudo dpkg -i *.deb

Add xorg-edgers amd Canonical X-Staging PPAs


sudo add-apt-repository ppa:canonical-x/x-staging
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install xserver-xorg-video-intel

Open Synaptic Package Manager and lock version (click on package then Package/Lock Version) of xserver-xorg-input-synaptics (should be version 1.6.3-0ubuntu1.1)



sudo add-apt-repository ppa:xorg-edgers/ppa 
sudo apt-get update && sudo apt-get upgrade

Install latest nvidia driver and create xorg.conf / .xsessionrc


sudo apt-get install nvidia-319
sudo vi /etc/X11/xorg.conf
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:01:00:0"  #adjust to your Nvidia's GPU ID if necessary
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "UseDisplayDevice" "none"  #only on muxless Laptop. Most are.
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Note : Your BusID can be obtained by running lspci | grep -i nvidia


sudo vi ~/.xsessionrc

xrandr --setprovideroutputsource Intel NVIDIA-0
xrandr --auto

Compile and install xrandr 1.4 from source


sudo apt-get install mesa-utils xutils-dev libxrandr-dev automake synaptic gksu
wget http://cgit.freedesktop.org/xorg/app/xrandr/snapshot/xrandr-1.4.0.tar.gz 
tar -xzvf xrandr-1.4.0.tar.gz
cd xrandr-1.4.0/
./autogen.sh
make
sudo make install

Add autologin feature in lightdm


sudo /usr/lib/lightdm/lightdm-set-defaults --autologin <username>

REBOOT and enjoy !!!

Add glxspheres to benchmark


wget http://ftp.jaist.ac.jp/pub/sourceforge/v/project/vi/virtualgl/VirtualGL/2.3.2/virtualgl_2.3.2_amd64.deb
sudo dpkg -i virtualgl_2.3.2_amd64.deb 
/opt/VirtualGL/bin/glxspheres64

P.S. : Thanks to @pogopuschel for providing the initial HOW-TO that I adapted according to my experience.

Note : after installing this driver the tap to click feature of the touchpad is not working anymore. It seems to be related to the version of the xserver-xorg-input-synaptics package (1.6.99+git20130104.ce7565ea-0ubuntu0sarvatt). If someone finds a way to fix it please share.

UPDATE 04/06/2013 : I found a way to fix the touchpad issue => see purple section above ! Cheers !

28 comments:

  1. I went one step further and did a dist-upgrade after adding the repositories. Now my touchpad is completely unresponsive. Thanks for the guide, though.

    ReplyDelete
  2. Fixed! See updated "Add xorg-edgers amd Canonical X-Staging PPAs" section!

    ReplyDelete
  3. Thanks, I'll do that next time. Have you managed to get HDMI audio out working?

    ReplyDelete
  4. No I didn't have the chance to try it yet... lately I was focused on how to make it work without HDMI connected ;-) I will maybe have to try it at some point, will keep you posted.

    ReplyDelete
  5. i get this error when trying to install xserver-xorg-video-intel

    "The following packages have unmet dependencies:
    xserver-xorg-video-intel : Depends: xorg-video-abi-13"

    i found this as a possible solution, http://askubuntu.com/questions/265531/under-system-settings-details-graphics-shown-as-unknown, but it did not help.

    any ideas? nvidia gt650m, 13.04_64

    ReplyDelete
  6. Thanks for your comment.

    After checking the version of xserver-xorg-video-intel on my side, which turns out to be 2:2.21.6-0ubuntu4.1 (the one provided by canonical-x/x-staging ppa), I think there is a little mistake in my howto ;-)

    I guess I installed xserver-xorg-video-intel after adding x-staging ppa and before xorg-edgers. Sorry about that, I updated the tutorial and will re-run the wole thing pretty soon to confirm unless someone confirms before.

    ReplyDelete
    Replies
    1. so i tried another fresh install and run at hte how-to. things got messy trying to unpack the xrandr tarball.

      i found another how-to on ubuntuusers.de which instructed to download an additional 3.9 kernel package. managed to get through all of the instructions, which are quite similar to yours, altho your lightdm tweak was necessary to not see a black screen.

      however, compiz is broken, as is unity. I had managed to do the same in a previous attempt to install.

      any ideas? I'm also using an asus, so i am confused :\

      Delete
    2. Same problem here, after the how-to unity/compiz are broken!

      Asus N56VZ...

      Delete
    3. @Randy
      Do you also have an UX51VZ ?

      On my side, and after having a lot of issues with Unity, I switched to Lubuntu/LXDE and since then everything is running fine. I think I re-installed ubuntu-desktop on the way though so if I can give it a try (time, time...) I will let you know how it goes.

      Delete
    4. no, i have an asus n76vz. i much prefer the look and feel of unity, so would rather that worked

      Delete
  7. Sebastien, are you able to use screens connected via HDMI with this solution?

    ReplyDelete
  8. @LiraNuna

    I didn't try out the 4K resolutions with the HDMI port since I don't have any 4K screen ;-)
    With these drivers you don't need bumblebee anymore... but for the battery life I didn't compare nvidia 319.23 with/without bumblebee.

    @Christian
    Yes HDMI is working using this solution. In my case I just have to comment out the line Option "UseDisplayDevice" "none" to get it working since the HDMI port is wired to the nvidia card.

    ReplyDelete
  9. Yes the nvidia card is always on.

    http://us.download.nvidia.com/XFree86/Linux-x86/319.12/README/randr14.html

    =>

    "The NVIDIA driver currently only supports the Source Output capability. It does not support render offload and cannot be used as an output sink."


    ReplyDelete
  10. Here is the correct link for 319.23 :

    http://us.download.nvidia.com/XFree86/Linux-x86/319.23/README/randr14.html

    ReplyDelete
  11. Yes it was already reported on this post : http://ux51vz.blogspot.ca/2013/03/enabling-function-keys.html

    On my side brightness is working, but keyboard backlight and sound mute/up/down are not :-( Seems to be related either to kernel 3.9 or to the nvidia driver, have to dig more on that point...

    ReplyDelete
  12. Thanks for blogging your experiences with this! I've been looking for an comparable product from the MacBook to install Linux on. No reason to give Apple more money.

    ReplyDelete
  13. Thanks Chad for your nice comment.
    Regarding your last statement, I guess we share the same vision :-D

    ReplyDelete
  14. Yes I still have Windows, I will try to find that info for you...

    ReplyDelete
  15. I was able to fix the Fn-Key problem with kernel 3.9.x using this workaround:

    - add this to /etc/default/grub

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

    - sudo update-grub

    - add this to /etc/initramfs-tools/modules

    asus-nb-wmi

    - sudo update-initramfs

    Reboot and enjoy :)

    Now all my Kn-Keys are working correctly (Asus N56VZ)!

    ReplyDelete
    Replies
    1. Thanks 0xCAFEBABE for your input, I was just about to give a shot to what I just found here : https://bbs.archlinux.org/viewtopic.php?id=162643 and you just confirmed the solution is working! Awesome!

      Delete
    2. I still have to test this on the UX51VZ, I will confirm asap if it fixes the issue as well.

      Delete
    3. were you able to get compiz working again?

      Delete
    4. In fact I think that the problem is not with Compiz but Unity! Because I tested Compiz without Unity and it works! Something must be broken in one of the PPA of the how-to...

      Delete
    5. Yes seems there is an issue between 13.04/unity and nvidia drivers (even stable) there is a shit load of people reporting issues if you just google "unity nvidia 13.04"...

      Delete
  16. @0xCAFEBABE Seems like your tweak is not working for me : I still get "asus-nb-wmi: probe of asus-nb-wmi failed with error -5" when running dmesg with 3.9 kernel.

    However I just tried kernel 3.8.25 to check and the keyboard backlight is now on but I cannot adjust it. Everything seems to work fine, so it seems that kernel 3.9 is not a pre-requisite anymore to install nvidia optimus drivers !

    ReplyDelete
  17. Hey Sebastien,

    Sorry to hear that it didn't work for you on 3.9 (I also get the error in dmesg but it works for me anyway)...

    With kernel 3.8 you might you to try this: instead of "acpci_osi=" try "acpi_osi=Linux" (don't forget to run update-grub after that), it was working for me when I was on 3.8! Also remove the module from the initramfs modules file, it should be loaded automatically!

    I gave up on trying to have a working Optimus solution for now, it works when I have "UseDisplayDevice" set to "none" and the HDMI monitor connected but not if the monitor isn't connected (laptop display only)!

    I hope they will fix this situation soon because it's ridiculous...

    ReplyDelete
  18. Hi LiraNuna, sorry for my - very - late reply I have been quite busy lately. Honestly, I didn't really monitor the impact on the battery life. Actually my laptop is plugged most of the time and the important thing for me was just HDMI out so that I can use my 24" external monitor.

    Also, it reminds me your request about the ambient light sensor.
    I didn't find any brand or anything but here are the driver files reported by the Device Manager :

    - SensorsAlsDriver.dll
    - acpials.sys
    - WUDFRd.sys

    I guess that's a start, tell me if you need more...

    ReplyDelete
  19. I am reading that blog since I have a ux51vz too...but some news would be nice. :D I am still with Win8 and it sucks. But i am not sure if everything works fine on ubuntu...so I keep waiting for updates.

    ReplyDelete