Thursday, January 5, 2012

multipath.conf - Qlogic qla2xxx, EMC Clarion and RHEL 5.7 64bit

Below is the configuration that I used for a server with Qlogic HBA card (qla2xxx driver) and EMC Clarion SAN storage.


defaults {
        udev_dir                /dev
        polling_interval        10
        selector                "round-robin 0"
        path_grouping_policy    failover
        getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
        prio_callout            "/bin/true"
        path_checker            tur
        rr_min_io               100
        rr_weight               uniform
        failback                immediate
        no_path_retry           12
        user_friendly_names     yes
}
blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^hd[a-z]"
        devnode "^cciss!c[0-9]d[0-9]*"
}
devices {
       device {
               vendor                  "DGC"
               product                 ".*"
               product_blacklist       "LUNZ"
               getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
               prio_callout            "/sbin/mpath_prio_alua /dev/%n"
               features                "1 queue_if_no_path"
               hardware_handler        "1 alua"
               path_grouping_policy    group_by_prio
               failback                immediate
               rr_weight               uniform
               no_path_retry           60
               rr_min_io               1000
               path_checker            emc_clariion
       }

}

I was getting "Buffer I/O error on device" when using "emc" handler. Hope it may help some one.

Friday, September 30, 2011

Tesla C2075 not detected by Nvidia control panel after installing Driver 275.89

Me and my friend brought two Tesla card for one of our HPC project. To my surprise after installing the new driver (Win7 64bit) for the Tesla C2075 compute board, Nvidia Control Panel won't start and gives out an error "You are not currently using any Display attached to an Nvidia GPU". But the windows device manager was listing it properly as a working card and there was no error in the system logs. It was really puzzling. 

After some time fiddling with the settings and Googling I found this Autodesk forum, which says that by default the new Win 7 driver sets TCC bit ON. So I started a command line in administrative mode and navigated to C:\Program Files\NVIDIA Corporation\NVSMI folder and issued the following command to disable the settings.

nvidia-smi.exe -dm 0

A reboot was required. And guess what the control panel started working as it was supposed to. Woooh ! it was a great relief coz I thought the board might have gone bad.

Monday, September 5, 2011

Show message on X desktop from cron.

Following will show an info message "Hello World" on the default desktop every hour.

0 * * * * DISPLAY=:0.0 /usr/bin/zenity --info --text "Hello World"

Tuesday, August 23, 2011

CUPS : Adding Job Accounting Number for UTAX printer CD 1120

Here is a simple step that I used to get the Job Accounting information or PIN working with UTAX CD 1120 printer.
  • Download the driver for UTAZ CD 1120 printer from here
  • Unzip it to a folder in your home directory. 
  • Open the PPD file corresponding to your printer (In my case UTAX_TA_CD_1120_English.PPD) using a text editor for example 'vi' 
  • Search for the keyword "Accounting". You will reach a line similar to "*OpenUI *KMManagement/Job Accounting: PickOne"
  • Move your cursor three or four line below. Your cursor should be now at line reading
    • *KMManagement MG0000/0000: "(0000) statusdict /setmanagementnumber get exec"
  • Edit the line and replace 0000 to what ever your printer accounting ID is.
  • Once editing is done, save the file and close.
  • As a precaution restart the cups daemon. /etc/init.d/cups restart.
  • Now starting adding the printer, selecting the newly edited PPD as the driver.
  • Once the installation is over, option the printer configuration gui and select Job Settings.
  • Scroll down where you can see Accounting information. Select your printer ID from the Job Accounting list.
  • Save the changes and send a test page. It should work now.

Thursday, July 28, 2011

Compiling Nvidia driver for Debian Squeeze 64bit.

Update (2) : It seems that the display driver fails to load with
dlopen: /usr/lib/xorg/modules/extensions//libglx.so: wrong ELF class: ELFCLASS64
----
----
dlopen: /usr/lib/xorg/modules/drivers//nvidia_drv.so: wrong ELF class: ELFCLASS64
After some googling, I found that the my system was installed with 32bit userland libraries (blame it on the DVD that came with my linux magazine), even though I have a amd64bit kernel.

So I re-installed the machine with the amd64 netinstall official CD downloaded from Debian, installed all necessary packages (list is given below), and re-run the installer again. Of-course, before running the installer, I have switched off GDM3 and added the black-list-configuration.
Packages
binutils
linux-headers-2.6.32-5-amd64
build-essential


cat /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0
As expected every thing now compiles normally (appart from the CC error, which can be corrected by setting CC env variable to /usr/bin/gcc-4.3, but  I didn't do that), all libraries and drivers were installed correctly and my Xorg works great, no error in /var/log/Xorg.0.log

All my posts regarding Nvidia driver is now invalid. Learned a good lesson also, read, read, read the documentation, specially the Nvidia's.
___________________________________________________________________________________

Update (1) : no need for all the below mentioned changes, set the CC environment variable with "-m64"  and re-run the installer directly.
# export CC="/usr/bin/gcc-4.3 -m64"
# ./NVIDIA-Linux-x86_64-275.21.run
Finally I was able to compile the latest version of Nvidia 64bit driver (NVIDIA-Linux-x86_64-275.21) for my Debian Squeeze 64bit. I was getting errors like

/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/conftest.h:38:2:
error: # error acpi_walk_namespace() conftest failed!
/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/conftest.h:42:2:
error: # error pci_dma_mapping_error() conftest failed!
In file included from /tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/nv.c:13:
/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/nv-linux.h:248:2:
error: #error "NV_PCI_DMA_MAPPING_ERROR() undefined!"
/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/nv-linux.h:253:6:
warning: "NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT" is not defined
/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/nv-linux.h:255:8:
warning: "NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT" is not defined
/tmp/selfgz13934/NVIDIA-Linux-x86_64-275.21/kernel/nv-linux.h:261:2:
error: #error "NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT value unrecognized!"

later I found out that the kernel/configtest.sh is failing to compile acpi_walk_namespace and acpi_walk_namespace and thus was unable to create object file configtest$$.o. 

So I tried an easy way by modifying the configtest.sh file. First I extracted the driver file using the command 

# ./NVIDIA-Linux-x86_64-275.21.run -x

This will create a folder named NVIDIA-Linux-x86_64-275.21 in the current folder. Change directory to ./NVIDIA-Linux-x86_64-275.21/kernel and modify the configtest.sh file. Below is the diff output for the same.

index 5b10bb1..eb5d192 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -955,7 +955,7 @@ compile_test() {
             $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
             rm -f conftest$$.c

-            if [ -f conftest$$.o ]; then
+            if [ ! -f conftest$$.o ]; then
                 rm -f conftest$$.o
                 echo "#define NV_ACPI_WALK_NAMESPACE_PRESENT" >> conftest.h
                 echo "#define NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT 6" >> conftest.h
@@ -1105,7 +1105,7 @@ compile_test() {
             $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
             rm -f conftest$$.c

-            if [ -f conftest$$.o ]; then
+            if [ ! -f conftest$$.o ]; then
                 echo "#define NV_PCI_DMA_MAPPING_ERROR_PRESENT" >> conftest.h
                 echo "#define NV_PCI_DMA_MAPPING_ERROR_ARGUMENT_COUNT 2" >> conftest.h
                 rm -f conftest$$.o

The idea is very simple, just added an ' ! ' to the " if " condition, where configtest.sh checks if the file configtest$$.o exists or not. Also please not that on Debian Squeeze the NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT takes only 6 arguments not 7. 

rerun ./nvidia-installer from the root folder where you extracted the Nvidia driver files.

Hope this would solve issues with Nvidia driver for some one.

Friday, July 22, 2011

Alsa Mixer - Unmute from command line.

Here are the commands that can be used to unmute audio on an Ubuntu system.

amixer set PCM  100% unmute
amixer set Headphone  100% unmute
amixer set Master  100% unmute

Found useful for alarm.

Sunday, July 10, 2011

How to reduce the size of a LVM2 loggical volume

For example to reduce the size of a logical volume /home to 10 GB, follow the commands listed below.

# umount /home
# resize2fs /dev/VolGroup00/homevol 10G
# lvreduce -L 10G /dev/VolGroup00/homevol
# fsck -f /dev/VolGroup00/homevol
# mount /home