• Increase font size
  • Default font size
  • Decrease font size

Install NI-VISA and NI-KAL on Mandriva 2009.1 (Spring)

Print PDF

Linux Mandriva 2009 is one of the distributions officially supported by NI-VISA 4.5, a collection of instrument drivers and tools provided by National Instruments in order to interface devices and instrumentation to LabVIEW and other NI software.

What they do not tell you (or maybe they do but I missed that) is that only Mandriva 2009.0 (which is the first release of 2009) is 100% compatible while 2009.1 (the one I unawarely installed) has a subtle difference that prevents NIKAL from installing. NIKAL is the base package for most drivers so it is crucial to the behavior of the whole NI-VISA suite. To be precise the difference is in the Linux kernels that ship with 2009.1 which miss one feature NIKAL relies on. I found the solution in this post.

The catch is in one small line of code which is missing from a kernel source file. I am sure there is a reason for this line being missing, but for the purpose of compiling and installing NIKAL that line is absolutely necessary. What you need to fix things:

  • as you will be recompiling the kernel you will need gcc and make installed, you can check that in Software Management or simply try to type those commands in a terminal
  • kernel sources will take up some space on your hard drive and even more is required for compiling them (up to 3 GB were used in my case in /usr/src), you can free up the space at the end of the process but you need it right now
  • you need to login into the terminal (Konsole Terminal on KDE) as root user, that is by typing su and providing your administrator password

This is how you proceed:

  • download kernel-source package for your currently running kernel (you'll know your kernel by typing uname -r in a terminal, look for that exact string in Mandriva Software Management, the name of the package will include kernel-source and the string you found plus an rpm extension)
  • your full kernel source will be located in /usr/src/linux (this is a link to the right directory, for example /usr/src/linux-

  • edit the file /usr/src/linux/arch/x86/kernel/init_task.c (you need to do so with write-permission, i.e. as root user, so it's best if you use a terminal based editor such as vim /usr/src/linux/arch/x86/kernel/init_task.c , if you haven't used vim before you might want to check out how it works, which is not immediately obvious)
  • once you've opened the file in an editor you can add the following line somewhere in the file (e.g. at the end):
  • save the file and exit the editor, now you are ready to compile the kernel
  • in terminal as root, move to /usr/linux (i.e. home directory of your kernel source code) and type the following commands:
    • make oldconfig
      this will recreate a .config file according to your system current configuration
    • make
      this compiles all source code (C files in source tree) (this will take an hour or more)
    • make modules_install
      will install your compiled modules (this will also take some time)
    • make install
      will copy the new kernel image to /boot directory, it will be available there along with those that were previously there, the one just created is simply called vmlinuz- in my case since I did not provide a name for it
  • you are now ready to reboot the computer into the "new" kernel, make install should have created a new entry in GRUB boot menu so make sure that you remember the name of the kernel you've just compiled and you choose that when prompted after restarting (it will not be the default choice)
  • after reboot you should be able to install NIKAL by using the provided INSTALL script in NI-VISA directory, in my case I already had a broken installation of NI-VISA so I only reinstalled NIKAL by downloading the latest version I could find (1.10), to do that you also use INSTALL script in NIKALxxx directory
  • since we have changed a few things, in case you had previously configured NI-VISA you should run updateNIDrivers as root in order to synchronize everything, if all goes well you should not see any error message and after a required reboot NI-VISA should be properly configured
  • make distclean
    typed in the directory where you previously built your kernel, will optionally delete all compiled kernel objects (those that took so long to be created!), leaving the original source in place. This will let you recover some disk space (around 3GB in my case) but if you want to compile the same kernel on the same system again you will need to go through the above steps. Note that the kernel image you created has been copied to your /boot directory and will not be touched by the above command.

A few notes:

  • for reasons I don't fully understand the system will at times not boot into the custom kernel (actually it will not load graphical X server), I suspect that is due to updates applied later which are not fully compatible with the custom kernel I compiled before. Oddly enough this is usually fixed by booting once into the default kernel and then booting again into the custom
  • the main reason I wanted to get NI-VISA working on a Linux system was to interface with USB RAW devices and this is what I am trying to do now, it looks like there are still a few hurdles ahead **

** UPDATE: access to a USB RAW device (EZ-USB chip from Cypress) works "out of the box" on OpenSUSE 11.0 without the need to create a driver through NI Driver Wizard, which is required on Windows. I only realized this after being stuck trying to get driverwizard to work, which as it turns out is not necessary. Will try on Mandriva as well. Works fine on Mandriva 2009.1 with LV 8.6 and VISA 4.5.1.

Last Updated on Tuesday, 04 May 2010 13:57  
Comments (1)
remember to add permissions for your USB device
1 Monday, 15 November 2010 16:58
refer to the README file that comes with NI-VISA, in most cases can just run:


(will need to enter PID and VID of the USB device)

after installing NI-VISA

Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification: