My New Blog
In future I’m going to be blogging here
Ubuntu 11.04 and nVidia Optimus
After installing Natty Narwhal on my new Packard Bell Easytone HR11 it booted into Gnome instead of the new Unity desktop. After googling around I discovered that the nVidia Optimus technology was to blame. Optimus switches from the low power consuming Intel GPU which is used for basic applications to the more powerful nVidia GPU when gaming or watching movies. Optimus, as delivered from nVidia, is not available for Ubuntu.
Fortunately here is a solution for using Optimus with Ubuntu called Bumblebee. to get Bumblebee up and running first open a terminal and add the Bumblebee repository and then install Bumblebee.
sudo apt-add-repository ppa:mj-casalogic/bumblebee
sudo apt-get update && sudo apt-get install bumblebee
During the installation you will be asked if you want to configure Bumblebee, select “Yes”. You will then be asked to select manual configuration or to view a list of configurations, select “Full List” and from the list select your laptop. If you have a Packard Bell Easynote pick “Packard Bell EasyNote TSX66HR: SteveYoung” and then “Use this Configuration”. In the next screen select “XV(Default)” You should then see a message saying that Bumblebee has been installed.
Now typing “optirun” before an application will cause the nVidia GPU to be used rather than the Intel GPU, with improved performance as can be seen below.
steve@steve:~$ optirun glxgears
* Starting Bumblebee X server bumblebee
_PS0 Enabling nVidia Card Succeeded.
[ OK ]
3178 frames in 5.0 seconds = 635.511 FPS
3326 frames in 5.0 seconds = 665.190 FPS
3122 frames in 5.0 seconds = 624.271 FPS
3250 frames in 5.0 seconds = 649.854 FPS
3174 frames in 5.0 seconds = 634.725 FPS
* Stopping Bumblebee X server bumblebee
_PS0 Disabling nVidia Card Succeeded.
As opposed to the fps without Bumblebee.
steve@steve:~$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
302 frames in 5.0 seconds = 60.277 FPS
301 frames in 5.0 seconds = 60.160 FPS
301 frames in 5.0 seconds = 60.160 FPS
301 frames in 5.0 seconds = 60.160 FPS
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 2757 requests (2757 known processed) with 0 events remaining.
You can also install the bumblebee.ui using
sudo apt-get install bumblebee-ui
This places an indicator in the Unity notification area which changes colour when the nVidia GPU is in use and also allows you to configure which applications to use “optirun” with automatically.
Bumblebee uses the nvidia-current driver and I am not sure that this is the best driver for the GT540M which is in my laptop. I think that the figures of 650fps achieved with optirun glxgears can be improved on and if anyone has any ideas about how to do this please share them with us.
Ubuntu 11.04. Wrong keyboard keeps reappearing as default
When I installed Ubuntu 11.04 on my laptop there was a problem with selecting a keyboard other than USA. If I selected any other keyboard the installation hung for minutes, so eventually I accepted the USA keyboard thinking I would change it later. Everything installed so I went to System Settings and chose Keyboard in the Control Center and under the Layout tab I removed the USA keyboard and added a German one.
However after every reboot the USA keyboard was back and worse still was default, so I had to keep switching back to German. Removing the USA only resulted in it reappearing after a reboot.
Eventually I found the answer. Go to /etc/default/keyboard and change the line XKBLAYOUT="us" to your desired keyboard and re-boot.
XKBMODEL="pc105"
#XKBLAYOUT="us"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS=""
No wireless networks with Easynote laptop and Ubuntu 11.04
I assume that all of these laptops use the broadcom wireless adapter but to check open a terminal and type:
sudo lshw -C network
The ethernet and wireless interface information will be shown.
If you indeed have a broadcom interface connect to the internet via an ethernet cable and open the Synaptic Packet Manager and install b43-fwcutter then firmware-b43-installer or open a terminal and type:
sudo apt-get install b43-fwcutter
sudo apt-get install firmware-b43-installer
Remove the the ethernet cable and restart Ubuntu and the wireless network should be available.
Packard Bell Easynote HR11 and Ubuntu 11.04 Natty Narwhal
I recently bought a laptop and installed Ubuntu 11.04 Natty Narwhal on it. As usual I will blog about any issues as and when they arise.
The laptop I bought is a Packard Bell Easynote HR11 and the first thing I did was to reduce the Windows partion. To do this I used the partition manager in windows 7 rather than risk using GParted with a Windows partition. I don’t know if this is necessary but I thought it was better to be safe than sorry and the tool is available for free in the Windows 7 anyway. A good Howto on shrinking the Windows partition is here
After shrinking the Windows partition I changed the BIOS boot order to make the DVD boot first and then inserted the Ubuntu 11.04 DVD and booted the laptop via the DVD.
From the menu I chose “install Ubuntu” and the installation started. There was a problem with choosing a keyboard during the installation and the installation hung if I chose anything other than a USA keyboard, so in the end I accepted the USA keyboard and the installation completed successfully. This keyboard issue was still giving me problems for a while after installation but I fixed it like this. After removing the DVD and re-booting I got the Grub menu with both Ubuntu 11.04 and Windows 7 as options plus some emergency recovery options. Ubuntu is the default and will run if you press enter or wait for 10 seconds.
My first disappointment was that the new desktop Unity didn’t start but instead I got Gnome. The reason for this lies in the Nvidia Optimus technology which switches from the Intel to the Nvidia GPU when more graphics power is required. I have managed to fix this problem for now but I still see room for improvement. You can read the blog about this here.
The second problem was the fact that the WLAN wasn’t working. I have blogged about how I solved this problem here.
XAMPP in Ubuntu. “/opt/lampp/bin/mysql.server: 84: source: not found.”
I am having a problem installing XAMPP because I have an Apache server already running, I will give details of how I get around this after I have fixed it. Meanwhile every time I started XAMPP with sudo /opt/lampp/lampp restart I got the following warning:
/opt/lampp/bin/mysql.server: 84: source: not found.
It turns out to be the old dash/bash problem that I wrote about over 3 years ago here
The solution is to change #!/bin/sh to #!/bin/bash in /opt/lampp/bin/mysql.server using Gedit sudo gedit /opt/lampp/bin/mysql.server
Javascript fifteen puzzle with pictures
I have written a JavaScript version of the famous fifteen puzzle which you can play online. You can play either the easy version with numbers on the tiles to help you or remove the numbers and play only with the tiles containing a part of the picture. High scores are recorded for both versions for both speed and minimum clicks. Please have a go and let me know what you think, suggestions for improvement are always welcome.
The game is here