Tuesday, 23 July 2013

The Optimus mess

Yeah, that's right. The Optimus mess. NO! This, is neither a critical writing of the character Optimus Prime, nor is this is a new episode, or fan-fiction of Transformers. In fact, this is not even remotely related to the Transformers franchise in any way (except for the naming scheme). This post, is about the new (not-so-new now) hybrid graphics technology by Nvidia.

Sometime in early 2010, I bought a laptop from Asus; Asus U41SV. This laptop comes with a 'standard voltage' i5 processor (2 cores/4 threads, 2.3GHz, 35 Watts), 4GiB of ram (which I upgraded to 8GiB), 650GiB HDD (which I replaced with a 1TiB HDD), and an 8-cell battery (which, I think is quite big). It also comes with a hybrid dual graphics solution called Nvidia Optimus. This solution consists of an Intel HD graphics chip, paired with an Nvidia GT540M 1GiB ram (which is kind of okay for games, but mostly average). This laptop also came preinstalled with Win7, and was advertised to have a battery life of 8-10 hours.

With Optimus, what actually happens during usage is that, during regular non-graphics intensive  tasks, such as web browsing, watching movies, and doing office apps, the power-hungry Nvidia chip is switched off, and only the intel graphic chip is used. This allows much power-saving during regular tasks. However, when launching graphics intensive apps such as 3d games, the Nvidia chip is turned on to render the complex graphics. This allows the laptop to use the high performance Nvidia chip to run graphics-demanding apps smoothly, but only when necessary. The trade-off is of course that running 3d games consumes more power.

My experience with the laptop on Win7 is that at lowest screen brightness, the laptop may idle for about 8 hours. At regular use of internet browsing, it may last up to 5-6 hours. This is not as much as the advertised battery life, but to me, it is still pretty great. When running some 3D games, the laptop may only last up to 1-2 hours. This does not matter much since "I don't always run games on my laptop but when I do, I plugged it to a power source" (I should make a meme of this, but meh).

However, when I installed Ubuntu 10.10, things don't work so well. At any time at all, the Nvidia chip is always turned on, but never used. The laptop only runs using the Intel chip for graphic processing, even though the Nvidia chip is using power. This results in a large power consumption in the laptop, unnecessary overheating, but none of the performance benefits of the Nvidia card. If I tried installing the non-free Nvidia driver, suddenly I get no graphics on my laptop.

Why is this happening you say? Nvidia did not provide support for Optimus on Linux, it's as simple as that. This caused much rage in the Linux community. There was, however an attempt to provide a solution to this problem by the community, by a software called Bumblebee and an ACPI call kernel module (I don't really understand all this, so don't take my word on this). What happens is that, at boot time, Bumblebee is started as a service/daemon, and will immediately send a signal through the acpi call module, to turn off the Nvidia card. If we need to run a software using the Nvidia card, for example, a game called xonotic, we use the command 'optirun'.

optirun xonotic

What this does is that it will tell Bumblebee to turn on the Nvidia card (acpi-call), load the Nvidia drivers, and use that to render graphics. So, you could still have the features of Optimus, on Linux. The problem was that around 2010/2011, this was still a bit patchy. Installation of Bumblebee was a hassle, not so noob-friendly, requiring you build the software from source. You also needed to manually configure the proper acpi-call. Whenever you need to use the Nvidia card, you need to use 'optirun' to tell Bumblebee to use Nvidia card, which feels inconvenient compared to how this is automatic in Win7.

However, things are better now. Distros now include Bumblebee in their repos, and detailed guides in their wikis. the acpi-call has been replaced with bbswitch, which does not need much to configure. At times however, I still get some difficulties when installing a Linux distro on my Optimus laptop, but most of the time, things work out in the end.

My experience with the laptop on Ubuntu is that at lowest screen brightness, the laptop may idle for about 2 hours without Bumblebee/bbswitch. With Bumblebee/bbswitch properly configured, idle time improves to 10 hours, which is just plain awesome! At regular use of internet browsing, it may last up to 6-7 hours.

In the end, I hardly do any 3d gaming at all that warrants me buying a laptop with the Nvidia card. I kind of regretted buying this laptop, but I did not even know about this Optimus thing until after I tried installing Linux. Since I mostly do regular office work, mostly using Linux, I could have bought a cheaper i3/i5, 'standard/ultra-low voltage' laptop with Intel graphics, and never had to worry about configuring Optimus. I find that the Nvidia chip is not necessary for my use. If I opted for an ultra-low voltage Intel cpu, I could find a lightweight laptop, with slightly smaller battery, maybe one of those 'ultrabooks'. But, this laptop has served me well these past years, ran quite well, and is quite responsive.

I am also very glad that people built the Bumblebee/bbswitch, which helped my laptop to run for hours on battery, and keeping it cool. KUDOS to the Bumblebee Project team, and the Ironhide developer!!!

But Nvidia Optimus, man, what a mess!!!

Monday, 15 July 2013

Painful Transition : Win7 to Ubuntu 10.10

Transitioning from Windows to Ubuntu Linux 10.10 (GNOME 2.x desktop), is painful. Sure, there are techniques that you can try to ease yourself into a GNU/Linux system, but in the end, it is painful.

User Interface : Win7 desktop to GNOME 2.x


For the most part, if you are willing to work a little bit harder to adapt to the different UI that is Gnome, than this is not too much trouble.

One most notable difference is the taskbar. In Win7, you have a taskbar at the bottom, which shows a list your favorite apps, currently open apps/windows, clock and notifications, and of course, the Start button which is used to launch apps. In Ubuntu 10.10, running Gnome 2.x, you have two panels. Most stuffs are at the top panel, but the list of opened apps/windows are at the bottom. It might get a bit confusing at first, but with time, this kind of arrangement makes sense.

Another important feature is that by default, Gnome desktop comes with multiple workspaces/virtual desktops. This allows you to better organize yourselves when multitasking with your PC. In Windows, suppose you are doing a bunch of things on the PC at the same time, you'll end up cluttering the desktop. With multiple workspaces, you can seperate windows/apps according to what kind of tasks you are doing withe them.

Example : I usually put things related to system maintenance on the 4th/last workspace, such as updates, system monitor (similar to task manager), and maybe CPU temperature monitor. On the 3rd workspace, I put apps that take a long time to run, such as burning DVDs, ripping movies, downloading files from internet. If I have a torrent app downloading something, I also put it here. 1st workspace is where I do most of my work, and 2nd workspace is used when I have to do something else which interrupts my current work.

All is awesome so far...

System and Security

Hardware and Drivers

From my experience with WinXP, Every time I installed a system, I have to spend a lot of time searching for hardware drivers, to get my devices working. If not, the desktop won't display correctly, and I won't get any sound. I also need to work a bit hard some times in order to get LAN and Wifi working. In Win7, as long as you set up Windows Updates properly (and have internet connection), it can also help pull those drivers for you from Microsoft, so you usually don't have to worry too much. If this fails however, you can still just go to the manufacturer's website to get drivers for your devices, and install them with a few mouse clicks. However, from my experience, there are some LAN and Wifi devices that won't just work out of the box in Win7, so if this is the case, updating other drivers will be a problem.

In Ubuntu Linux, I have no idea exactly how drivers are handled, but from my understanding, the Install CD provides out-of-the-box support for a large collection of hardware that you might encounter. My experience with Ubuntu (and most other Gnu/Linux distros) has been that most things just work after the first install, with a few exceptions. There is a type of Broadcom Wifi adapter that I found did not install automatically, but this could be fixed by searching for "broadcom firmware" in software center, and installing the packages manually (took some lengthy searches on Google though..). My printer (canon mp250) drivers also had to be installed manually this way. However, this was still back in 2010. By year 2012, I found that everything just work immediately after first install.

Viruses 


One thing I hate the most about Windows system is viruses, and the necessity of antivirus programs. At the university where I study, pretty much every computer that you can find runs Windows, and each and every one of them manages to contract some kind of virus and malware. The most apparent is the kind that spreads through inserting thumb-drives. Because the students and lecturers exchanged lecture notes using thumb drives a lot, this resulted in pretty much every PCs and laptops belonging to every student and lecturer getting infected. Most antivirus won't detect these, and even if they could, they have little success removing them. Plus, they only slowdown your laptop anyway.

With a Gnu/Linux system, such as Ubuntu however, the virus don't work, and you don't need any antivirus (as far as I know). So if someone connects an infected thumb-drive to my laptop, nothing happens. No infections, nothing.

User Password

Another thing to note, is the user password. In Windows, because I rarely handle any sensitive material, and I am the only user of my PC/Laptop, I make it a (bad) habit of not having a login/user password. At boot, the system automatically logs into my user account, and I can use everything. This is okay if security is not a concern. I can also install any apps I want, provided that I am an 'Administrator'.

In Ubuntu, you can also limit yourself to a single 'administrator' type (sudoer) user for my own use. However, the system kind of 'force' you to have a user password. If you decide that you don't want to have to type your password during login, suddenly your wifi won't connect because your 'keyring is locked', and you have to type your password anyway. Additionally, in most other Gnu/Linux systems, there is a special user called 'root'. The root can pretty much do anything to the system, modify any config files, etc. Only the root user can install apps, and you need to type the root password before doing so. However, an 'Administrator'(sudoer in linux) type user can also do things with 'root' level access, using the user's own password, and this is the common way of installing apps in Ubuntu.

This part is not much problem, as long as you don't mind typing your password when asked. However, you will also find yourself typing your user password a lot when you need to install apps, configure the system frequently.

Apps and compatibility

Updates and install methods

One thing to note is that the way that most Gnu/Linux systems install software and updates are a bit different compared to Win7. In Windows, your system is subscribed to Microsoft's server for system updates. Every fixed time period, your win7 system will check with Microsoft for any new system updates, and install them for you. If you need a particular app, such as a new music player, a new graphics editor, you download the installer from its website, and you install it. If new updates for the software are available, what you do is you either download and install the newer version, or the software must come with its own built-in updater which does this automatically.

In Ubuntu, all system updates, system component installs, apps installs and updates are handled by the Ubuntu Software Center. By default, software center is subscribed to Ubuntu software repositories for system and apps updates. When you need new software, you first search the software center, and install it from there. When new version comes up, software center handles all system and app updates for you. IF the app you want is not available in software center, you can either download the .deb package for it and install in manually, or if a custom repository is available, add that to your software center so that you also receive updates automatically. Neat huh?

Compatibility

Unfortunately, there are a lot of software/apps that are only available for Windows, and not on Gnu/Linux. Most notably are MS Office collection, Adobe suites and a bunch of modern PC games, made only for windows. It is possible to run them in Ubuntu using Wine and Playonlinux, BUT, it takes too much trouble and most of the cases, they don't run very well.

Common Apps for Common Tasks

Web browsers.

When I first started using Windows, I have always used Internet Explorer. Then, friends of mine introduced Firefox, and soon after, I also tried Google Chrome. I have always switched between the two, and have never found the need for other browsers. Fortunately, both are available in Ubuntu, just might take some effort in learning how to install them.

Music and Videos

In Ubuntu, the default players are fine when playing media, but the required codecs are not installed by default. To solve this, look for "ubuntu restricted extras" in software center and install that. VLC video player is also available in software center, and I use that most of the time.

Ubuntu (like many other Gnu/Linux distros) also offers video and audio editing software, but because I never do any editing myself, I can't comment on this. There are also tools for CD/DVD burning and ripping tools, and tools for converting media files to different codecs.

Office

Here is where the problem comes. Pretty much everyone I know use some version of MS Office exclusively. I too, used MS Office previously. The only obvious choice for an Office Suite in Gnu/Linux system is Libreoffice (Openoffice during the year 2010). This is simply because it is the only one with 'some' compatibility with MS Office files, and it also has the most features.

By default, Libreoffice/Openoffice saves in the open document formats (.odt for text and .ods for spreadsheets) where they work best, but they can also work with and save in MS Office formats (.doc, .docx, .xls, and .xlsx). MS Office, as of version 2010 however is not meant to work with open document formats, so if I converted my files to that, I won't be able to share them with others.

In reality, Libreoffice/Openoffice works 'okay' with .doc and .xls, but 'barely works' with the newer .docx and .xlsx. When I transitioned to Ubuntu, I made it a point to convert every document I was working on to OpenDocumentFormat, and use Open Office exclusively. If I have to send some files to others, I mostly just send pdf. But yeah, I suffered a bit because I could not share files with friends quite like before.

IF you don't mind working exclusively with LO/OO exclusively in Linux to prepare your documents, then you can do as I did. Convert everything to opendocument. In my opinion, this is the best way to work after all. Since LO also works on Windows and Mac OS, If you need to send your docs to a friend, try asking him to install LO in his computer. Maybe you'll get lucky, because I think, if you can make a person start using free software, you are one step closer towards making him switch to a free OS.

But there is also an advantage for using Libreoffice/Openoffice. The software is FREE (as in free of charge), and FREE (as in freedom). And, when a new version of LO/OO is available for my Ubuntu, It can be downloaded and installed directly to my laptop, automatically. When new MS Office is released, you need to fork some cash to get it at the store.

LO/OO does need some time getting used to, especially since I transitioned from MSO 2007 and 2010. However, if you have experience using MSO 2003, you should be okay because the interface looks similar.


This pretty much summarizes most of my experiences switching from Win7 to Ubuntu 10.10. It was not too easy, but it was worth it. To this day, I have found that using a Gnu/Linux system is much more 'fun', and more rewarding, so I highly recommend it.