How-to Install Nvidia Driver on 2.6.25-2 Debian Kernel (with Xen)

Another big surprise rolled out from the Debian Unstable repository when today I updated my kernel from 2.6.25-1 to 2.6.25-2 – the maintainers have enabled Xen in the non-Xen kernel (linux-image-2.6.25-2-686). The result from this is that Nvidia drivers don’t compile throwing error about Xen enabled kernel.

The solution (if you don’t want to recompile your own kernel) :

As usual backup before executing any of these :)

  1. cd /lib/modules/2.6.25-2-686 (or wherever are your modules)
  2. grep CONFIG_XEN . -Rl | xargs -i sed -i -e ‘s/CONFIG_XEN/CONFIG_LUPO/g’ {}
  3. export IGNORE_XEN_PRESENCE=1
  4. sh NVIDIA-Linux-x86-173.08-pkg1.run (or you can use patched 169.12 – http://www.nvnews.net/vbulletin/showthread.php?t=110088 )

Source: linux-image-2.6.25-2-686: nVidia driver fails to compile due to active Xen support

May 25, 2008 · Peter

How-to Install VMware Player / Workstation on 2.6.25 Kernel

Update: Looking for 2.6.26 howto – here you go !

After the successful (How-to install VMware Player and Workstation on 2.6.24 Linux kernel)[/linux/how-to-install-vmware-player-workstation-on-2624-kernel] and with 2.6.25 up and running on my Debian Unstable (Sid) I had no option but to update the procedure.

  1. Download latest and greatest products from VMware
  2. Install and patch as described in the previous post (use vmware-any-any-update-116.tgz)
  3. Download the vmware-any-any-update-117-very-ALPHA.tgz
  4. Extract the archive in /usr/lib/vmware/modules/source (or wherever are yours vmblock.tar, vmmon.tar, vmnet.tar)
  5. Run vmware-2.6.25.sh and then vmware-config.pl
  6. If compiles – have fun, if not drop me a line :)

Important notes:

  1. The original author of the patches is 6xx I have modified the vmmon.patch since otherwise I was getting the error at the bottom of the article. The original patches can be found here
  2. vmware-2.6.25.sh is a very dumb script – read it carefully before executing. It will be even better to paste the commands one by one
  3. This any-any patch has nothing to do with the original any-any patches by Petr therefor I do not want to take the credit for it. All I’m trying to achieve is to gather the Linux VMware community here and share ideas. If someone wants to help and make the patches more unified and smarter just drop me a mail (can be found on the home page)
  4. I take no responsibility for any problems or damage that may
    occur as a result of using any of the information contained in this article.
    Use the information at your own risk ;)

Error log:

include/asm/page.h: In function ‘pte_t native_make_pte(pteval_t)’:
include/asm/page.h:128: error: expected primary-expression before ‘)’ token
include/asm/page.h:128: error: expected ‘;’ before ‘{’ token
include/asm/page.h:128: error: expected primary-expression before ‘.’ token
include/asm/page.h:128: error: expected `;' before ‘}’ token
include/asm/paravirt.h: In function ‘pte_t __pte(pteval_t)’:
include/asm/paravirt.h:955: error: expected primary-expression before ‘)’ token
include/asm/paravirt.h:955: error: expected ‘;’ before ‘{’ token
include/asm/paravirt.h:955: error: expected primary-expression before ‘.’ token
include/asm/paravirt.h:955: error: expected `;' before ‘}’ token
include/asm/paravirt.h: In function ‘void pmd_clear(pmd_t*)’:
include/asm/paravirt.h:1171: warning: missing braces around initializer for ‘pud_t’
include/asm/paravirt.h:1171: warning: missing braces around initializer for ‘pgd_t’
include/asm/paravirt.h:1171: error: cannot convert ‘pud_t’ to ‘pgdval_t’ in initialization
make[2]: *** [/tmp/vmware-config2/vmmon-only/common/task.o] Error 1
make[1]: *** [_module_/tmp/vmware-config2/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.25-1-686'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config2/vmmon-only'
Unable to build the vmmon module.
May 7, 2008 · Peter

Downtime due to WordPress 2.5 high CPU usage

Sorry for the downtime guys. I have reached my CPU usage limit due to turning on automatic database backup feature in WordPress (or something else – not quite sure).

Lets hope from now on everything will be ok.

Update:

With my blog suspended for second time I got really pissed and investigated the reasons. My previous believes about buggy pluggins was not correct and with little googling I found out that WordPress 2.5.x has some serious problem with CPU usage. As I examined my load logs it is obvious that the PHP process is using more than 5 times as previous versions.

The solution is either to install WP Super Cache or to downgrade to the previous version before 2.5.

April 30, 2008 · Peter

Howto Create Lossless Flash Screen Captures (Screencasts) for Free

Two weeks ago I started my search for free solution that can do cross-browser and cross-platform screen captures. After couple of days I understood that creating screencasts without using Camtasia is hard because I needed something that can do the following:

  1. Produce Flash Video (FLV) which is good for streaming
  2. Use a lossless codec for great quality
  3. Works under Windows XP
  4. Gives good quality/size ratio

The solution is Camstudio + Camstudio Lossless Codec + miniRec + FFmpeg

Camstudio is free open source screen capture software (in relatively mature state) with great set of features described on the official website ,blog and forum

Camstudio Lossless Codec is not really necessary because exporting in uncompressed video works too but requires alot more space. I tried other lossless video formats like MSU Screen Capture Lossless Codec but since I’m converting it in Flash Screen Video it doesn’t make much difference.

miniRec Audio Recorder is nice and very simple application for recording your voice while capturing the video stream. While Camstudio has build-in audio recording support I had too much troubles with it (the encoded FLVs had some strange bugs) so I’m just recording it separately.

FFMpeg – as usual the cherry of the pie now with support for the Flash Screen Video format (flashsv). With its help it is easy to produce high quality lossless FLVs with relatively small size.

How it all works out:

  1. Install Camstudio 2.5 Beta 1 – there are many tutorials on youtube about it and I’ll skip this step. Also you can check the official install screencast – http://camstudio.org/video/install/ which is for abit older version
  2. Install Camstudio Lossless Codec – it is quite easy, just download the archive, extract it somewhere, right click on the inf file and chose install
  3. Run Camstudio and click on Options –> Video Options. For me the best settings for getting as small as possible files are like this:

Camstudio Settings

(If you have any better suggestions please share with me)

  1. Download and install miniRec from here. I have not used any special settings since the voice is compressed by FFmpeg while merging the video and audio streams. My suggestion is to set a global shortcut key for both miniRec and Camstudio so it is possible to fire them almost simultaniously.
  2. Record all you want :)
  3. Get FFmpeg. There are versions both for linux and windows. I’m currently using SVN-r12810 but anything relativly recent should do the trick.
  4. The magic for converting your avi to flv is:
    ffmpeg -i input.avi -vcodec flashsv output.flv
    if you are joining with the audio use:
    ffmpeg -i input.avi -i input.wav -ar 22050 -vcodec flashsv output.flv
  5. And the result will be like this:
You do not have flash installed.

PS. The song that is used in the screencast is under Creative Commons and can be found here

April 20, 2008 · Peter

Howto Optimize Rendering Speed of ASP.NET Ajax Websites

A common case for most ASP.NET sites is slow frontend rendering due to many Javascripts. The typical requests graph looks like this:

ASP.NET Rendering Graph

All these AXD files are embedded Web Resources usually Javascripts and sometimes CSSs. The bad news about having many embedded Javascripts are:

  1. Many HTTP Requests (meaning generating more load to the web server)
  2. Poor rendering time because when the browser starts downloading a Javascript file it stops downloading(rendering) everything else (easily seen on the graph)
  3. Less chance for caching any of those files
  4. If HTTP compression is enabled in the IIS many files mean more load and worse compression ratio than one merged file.

The most common scenario for having many embedded Javascripts is either using AJAX or some commercial .NET controls.

The solution for merging AJAX AXDs in a single file is described in those two great posts:

Script combining made easy [Overview of the AJAX Control Toolkit’s ToolkitScriptManager]

and

Script combining made better [Overview of improvements to the AJAX Control Toolkit’s ToolkitScriptManager]

The recapitulation when with a friend of mine (Julian) tested out this technique was reducing the loading time with about 2 seconds on a quite clean and well build site. Also the better HTTP compression reduced the size a bit.

If you are using ComponentArt’s Web.UI version 2007.2 or later controls there is solution posted on their blogs too:

Optimizing Web.UI Client Script Deployment

And couple more general advices:

  1. If it depends on you merge all your Javascript and CSS files
  2. Load CSS at most top of you page
  3. Load Javascripts at most bottom of your page (if possible)
  4. Minify both Javascripts and CSSs
  5. Be smart :)

Update: Stefan Dobrev sent me a link for moving the AJAX Javascripts to the bottom (point 3 of the list above) which should improve rendering time too. Thanks Stefan

April 14, 2008 · Peter