Wednesday, 30 October 2013

Install Lubuntu 13.10 (Saucy Salamander) with nvidia drivers and keep Windows 8 on the side

Long time no blog... quite busy both at work and with my little one ;-)
Barely have time to play around with my laptop...

So here is the deal :

1) Install Lubuntu 13.04 following one of my previous posts (why starting with 13.04 ? Because the alternate installer for 13.10 is crashing during software installation :-( - at least for me)

2) When you have 13.04 fresh, just perform a :

sudo do-release-upgrade and follow instructions

3) Then (don't install nvidia-prime yet or it will mess up everything unless you're on unflavored Ubuntu) :

sudo apt-get install nvidia-319 nvidia-settings-319

4) For your records, here is the original thread on launchpad regarding the nvidia-prime issue :



and install it using :

sudo dpkg -i nvidia-prime_0.4.2~ubuntu13.10.1_all.deb

5) Reboot and enjoy nvidia power ;-)

6) Also, if you ever lost your Windows 8 entry in grub on the way, here is the magic recipe :

sudo vi /etc/default/grub and add GRUB_DISABLE_OS_PROBER=true at the end

7) Search for the magic String !
This command :

sudo grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

will output a String like XXXX-XXXX, copy it and then create a custom menu entry for Windows 8 with sudo vi /etc/grub.d/40_custom like this :

menuentry "Microsoft Windows_8" {
search --fs-uuid --no-floppy --set=root XXXX-XXXX
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

8) Run sudo update-grub2 so that the menu entries gets regenerated

9) Reboot and enjoy !



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 !

Tuesday, 14 May 2013

Quickest way to install/reinstall Ubuntu 13.04

After applying several updates (12.04 LTS > 12.10 > 13.04) and messing around with the nvidia drivers, my Ubuntu install became a bit unstable... so I wanted to find a quick way to re-install 13.04 to be able to mess around again but from a clean install ;-)

The main hurdle here is that the main Ubuntu distribution does not provide the alternate installer (which embeds raid support) anymore...

However, I recently found out that the Lubuntu distribution still provides the alternate installer !
ISO image is available here : http://cdimages.ubuntu.com/lubuntu/releases/raring/release/

After my first try to install Lubuntu, Windows 8 was actually removed from the EFI loader (even from the bios). I followed the instructions posted here : http://www.tweakhound.com/2012/11/13/how-to-fix-the-windows-bootloader/ and hopefully the automatic repair worked for me (don't forget you need to make a recovery drive in Windows 8 prior to do this).

Other than that, I'm now running Lubuntu and find it great (quick to install, minimal set of apps, etc.)

I can now see that HDMI is supported out the box (with the nouveau driver) but is really buggy and cannot be used as is. Next step for me is to try to install the latest beta nvidia drivers with Optimus support again... Will keep you posted on that.

Thursday, 25 April 2013

HOW-TO install nvidia 319.12 drivers on Ubuntu 13.04 [Dual Screen with HDMI working!]

Hi there,

Just wanted to confirm that I was - finally @2am today - be able to install the latest nvidia 319.12[beta] drivers that now support Optimus natively (no need for bumblebee anymore).

Thanks a lot to pogopuschel (from the nvidia forums) who figured out the steps to be able to make it!

The most important feature it enables (at least for me) is that now you can have dual screen working if you're using an HDMI external monitor (VGA was already working out of the box), so after frustration comes a big relief !

I will try to put together an HOW-TO asap but for the impatients I invite you to check his thread on the nvidia forums :

https://devtalk.nvidia.com/default/topic/539322/linux/blank-screen-with-319-12-on-optimus-laptop/3/?offset=38

UPDATE : in fact pogopuschel has already put together the HOW-TO here :

http://paste.ubuntu.com/5601226 

UPDATE (30/04) : seems like there is no need to downgrade anymore (check the nvidia thread). I have to test that asap.

Also, I wanted to mention that in my case the setup is only working if I use an external HDMI Monitor. In that case I'm able to login (with no .xsessionrc) on the HDMI Monitor and after login executing this xrandr command will enable my laptop display :

xrandr --setprovideroutputsource modesetting NVIDIA-0
(at this stage intel or modesetting are both working for me)

Good news is that dual screen is now working but I couldn't get it working (black screen) yet when using laptop display only... :-(

Cheers!

Monday, 15 April 2013

Nvidia 319.12 drivers and Optimus

Finally it seems that Nvidia has released Linux beta drivers that include support for Optimus and RandR 1.4 according to this article :

http://www.phoronix.com/scan.php?page=news_item&px=MTM0NzE

That's a really good news since it brings hope for all Optimus laptop owners to have native support of the Nvidia GPU including HDMI output and so on...

Can't wait to test this along with Ubuntu 13.04 when they will both be stable/released!

Monday, 18 March 2013

WTF : invalid arch independent ELF magic ?

As I booted my laptop today I got into grub rescue with this nasty error message : "invalid arch independent ELF magic". Everything was working fine so far so I assume 1 update blew up my grub :-(


Trying to fix that issue, I put Ubuntu Secure Remix on s USB stick so that I could use boot-repair (https://help.ubuntu.com/community/Boot-Repair) to repair grub.

When executing the commands recommended by boot-repair to remove grub, I then came into that issue : "files list file for package libdrm-intel1:amd64 is missing final newline". I could fix it using the python script here :

http://ubuntuforums.org/showthread.php?t=1319791

Then I hit another similar issue : "files list file for package `tango-icon-theme' contains empty filename"

Thanks to this thread http://ubuntuforums.org/showthread.php?t=2045017 I figured out that just apt-get install tango-icon-theme will do the trick.

Now I can effectively use boot-repair !
Take a deep breath, the fun is just about to start.

1) At my 1st attempt using boot-repair, it failed because of this error :
Reinstall the grub-efi linux of mapper/isw_bicccigiih_RAID0SYS6
mkdir: cannot create directory `/boot/efi/EFI/ubuntu': Input/output error
grub-install --efi-directory=/boot/efi --target=x86_64-efi : exit code of grub-install :1
 
BootInfo summary : http://paste.ubuntu.com/5621193/

2) At my 2nd attempt (I rebooted and forgot to add-apt-repository ppa:yannubuntu/boot-repair), I could successfully repair grub (!) :

BootInfo summary : http://paste.ubuntu.com/5621275/

But when I rebooted I ran into "file '/boot/grub/x86_64-efi/normal.mod' not found". I could then figure out that it was because I was not using the latest version of boot-repair thanks to this thread http://forum.ubuntu-fr.org/viewtopic.php?id=1148581 (in French)

3) After that I ran boot-repair another time and I'm still stuck with the same issue I had at step 1 ! :
mkdir: cannot create directory `/boot/efi/EFI/ubuntu': Input/output error

BootInfo summary : http://paste.ubuntu.com/5621363/

At this stage I figured out that I was just another one affected by this issue : https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1090829

4) Decided to run e2fsck -f -y -v /dev/mapper/isw_bicccigiih_RAID0SYS6 and after that boot-repair ended up by successfully reinstalling grub ! :

BootInfo summary : http://paste.ubuntu.com/5623554/ 

5) After reboot, I know have another issue in grub (come on...!):

error:invalid magic number
error:you need to load the kernel first

6) Ran boot-repair one more time. In the advanced options I checked "Reinstall latest kernel". At some point I had to manually remove /boot/mykernel with rm -rf or dpkg will complain that it cannot remove the directory or something similar.

Then boot-repair completed successfully ! (sigh)

BootInfo summary : http://paste.ubuntu.com/5624239/

Special thanks to YannBuntu for this great tool !

Sunday, 10 March 2013

Enabling function keys


To enable functions keys on the UX51VZ, do :

sudo sed -i s/quiet/quiet\ acpi_osi=/g /etc/default/grub
sudo update-grub

Thanks to the AsusZenbookPrime Ubuntu page !

P.S. : I did try the installation of the 3.8 kernel (https://help.ubuntu.com/community/AsusZenbookPrime#Upgrading_Linux_kernel_manually) but in my case it didn't solve the HDMI issue... However it seems that for the UX31/UX32 it did the trick. I know that UX32VD embeds the GT620M whereas the UX51VZ is equipped with the GT650M but at least I tried...

Monday, 18 February 2013

Upgrading to 12.10 to fix some issues

After discovering some issues (no right click & window move/resize with the clickpad, failed detecting external hdmi monitor and VERY slow wifi), I decided to give it a shot and upgraded to 12.10.

Got an error during setup regarding libdrm2 library that I easily fixed following instructions in this post : http://www.kubuntuforums.net/showthread.php?60545-Upgrade-install-issue-libdrm2

After upgrade to 12.10 :

- Right click / Window resize-move : fixed
- Wifi performance : seems to be fixed since kernel 3.6 (source : https://help.ubuntu.com/community/AsusZenbookPrime)
- External HDMI Monitor detection : still not working (I have to mention that I also installed Bumblebee (https://wiki.ubuntu.com/Bumblebee))

Regarding The HDMI issue, it seems it's a known issue for optimus cards.
In fact, it seems that the HDMI port is actually attached to the nvidia card but HDMI is not currently supported with Bumblebee.

A list of a few interesting threads around optimus support in Linux and issues :

http://en.wikipedia.org/wiki/Nvidia_Optimus
http://eternalvoid.net/tutorials/linux-optimus-gt650m
http://www.webupd8.org/2012/08/get-hdmi-working-with-nvidia-optimus-on.html
https://wiki.ubuntu.com/HardwareSupport/Machines/Laptops/Dell/XPS/15z
http://doc.ubuntu-fr.org/nvidia_optimus (in French)
http://askubuntu.com/questions/252993/run-unity-on-external-monitor-with-bumblebee
http://airlied.livejournal.com/

Seems to me that for now the quickest way to get multi monitor working properly and easily for now is to buy a Mini Display port to HDMI adapter ... :-D

Update 07/03/2013 : Just figured out that this is NOT a Mini Display port but a MiNi VGA port, crap ! :-(

To be continued...

Tuesday, 5 February 2013

Installing Ubuntu 12.04

As an Asus Laptop fan from the early days, I rewarded myself recently with the new Asus UX51VZ-XH71 as soon as it was out here in Canada.

This laptop comes with Windows 8 Pro out of the box and I want to setup dual boot since my spouse is more comfortable overall with Windows. (She can use Ubuntu but not convinced yet, have to work harder on that...)

To make a short story, the laptop comes pre-configured with a "fake" RAID 0 array and Windows 8 EFI boot, so the idea here is to find a way to install Ubuntu on the same raid array without blowing Windows 8 installation and recovery partition...
Go !

1) Boot into Windows 8, go to Manage/Disk Manager and remove partition associated with D: which takes half of the total space and is empty... and which is therefore a good candidate for installing Ubuntu on it !

2) Download Ubuntu 12.04.1 LTS Alternate iso here : http://releases.ubuntu.com/precise/ubuntu-12.04.1-alternate-amd64.iso (required to detect the "fake" RAID 0 array)

3) Follow instructions here : https://help.ubuntu.com/community/Installation/FromUSBStick to build a bootable USB stick

Note : First I used Universal USB installer in Windows to create it but then I ran into this bug : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1041911
My advice here to to build the stick from another Ubuntu machine using dd in command line or "Startup Disk Creator" in Applications/System

4) Boot on the USB stick (to change boot priorities or to select an UEFI device to boot from, hit F2 at boot). At some point the installation will ask if you want to load RAID drivers, say YES and the installer will be able to read partitions on the array. I personally used the option "use the largest contiguous space" when the installer asked me on which partition to install. Next. Next. Ubuntu is installed.

5) When you will reboot, you should now have a GRUB menu that pops up with both Ubuntu & Windows 8 entries.  At this point Ubuntu entries work, Windows 8 don't !
And the only way to boot Windows 8 for now is to hit F2 at startup and select "Windows Boot Manager" in the list of UEFI devices.

6) Don't panic, we are going to fix this. os-prober actually generates bad entries in the Grub menu and we need to tweak this for UEFI support as well.

7) Boot up Ubuntu. Open a terminal and run :

sudo apt-get install grub2

sudo vi /etc/default/grub and add GRUB_DISABLE_OS_PROBER=true at the end

8) Search for the magic String !
This command :

sudo grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

will output a String like XXXX-XXXX, copy it and then create a custom menu entry for Windows 8 with sudo vi /etc/grub.d/40_custom like this :

menuentry "Microsoft Windows_8" {
    search --fs-uuid --no-floppy --set=root XXXX-XXXX
    chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

9) Run sudo update-grub2 so that the menu entries gets regenerated

10) Reboot and enjoy !

P.S. : Thanks to smaug____ from the notebookreview.com forums for figuring most of this out (for Fedora) based on this thread : http://forums.fedoraforum.org/showthread.php?t=287725