NVIDIA Driver Update in AWIPS OB9.1 and FXC Performance

 

As most of you know, the graphics cards used on the current AWIPS LX boxes are made by NVIDIA. What you may not be aware of is that new default settings for accelerated graphics rendering were added with version 180.22 and later versions of the NVIDIA display driver. One of these default settings changed by NVIDIA was to prevent shared memory from being used for certain graphical elements (namely pixmaps). The 180.22 version of driver is included in RHEL 5.2 and arrived to the AWIPS workstations via OB 9.1

WFO FSD has verified that the default setting for "AllowSHMPixmaps" negatively impacts FXC performance especially when drawing/moving lines and shapes. I suspect this default setting could also have a negative impact on other AWIPS applications. This would be especially true for Java applications that haven't adapted to how modern accelerated graphics cards techniques that utilize video and system memory for pixmap caching.

 
In trying to resolve my FXC issue, I came across two solutions that could easily be implemented at the WFO level. Both of these solutions need to be reviewed to ensure a change doesn't negatively impact other AWIPS applications and system performance. I suspect there are additional solutions available to the software developers that do not require a change in the NVIDIA driver settings.


Issue Details

Starting with NVIDIA driver 180.22, shared memory for X pixmaps were disabled by default.  This change was done by NVIDIA because caching/rendering pixmaps in shared memory can prevent NVIDIA driver from performing a number of optimizations and degrade performance in many circumstances. However, this change does have negative impact for applications that are inefficient when pixmaps are stored in video memory instead of system memory such as some Java applications using the X11 Java2D pipeline

 

Pixmaps that are not in shared memory might be stored in VRAM, which allows for fast copies to the screen, but reading from these images is very slow, as described in the section Accelerated-Image Reading Performance Improvements . Since Shared Memory Extension is now accessible in the local display environment, images that experience frequent reads can be stored in Shared Memory Pixmaps, which always reside in system memory. Java 2D can detect if an image is read from more frequently or copied from more frequently and can transfer the image to the appropriate memory. You can control which memory is used by setting the J2D_PIXMAPS environment variable described in section Environment Flag for Solaris and Linux . Cited from: http://java.sun.com/products/java-media/2D/perf_graphics.html .

 

It should be emphasized that this issue is not a bug in the NVIDIA driver. I've verified that newer versions of the NVIDIA driver also contain the same default settings as 180.22 and additional graphics card vendors are going this route.


Solution #1.

One of the easiest solutions for fixing FXC performance would be to enable the use X pixmap shared memory though the NVIDIA driver utilizing the X11 xorg.conf file.

 

Option "AllowSHMPixmaps" "boolean"

This option controls whether applications can use the MIT-SHM X extension to create pixmaps whose contents are shared between the X server and the client. These pixmaps prevent the NVIDIA driver from performing a number of optimizations and degrade performance in many circumstances.

Disabling this option disables only shared memory pixmaps. Applications can still use the MIT-SHM extension to transfer data to the X server through shared memory using XShmPutImage.

Default: off (shared memory pixmaps are not allowed).

Reference: http://us.download.nvidia.com/XFree86/Linux-x86/180.22/README/appendix-b.html

 

FSD has verified that enabling "AllowSHMPixmaps" does improve FXC performance. As far as I can tell, by enabling this change all we're doing is allowing for the use of shared memory for pixmaps to return to how the driver was set before AWIPS OB 9.1. The impact this setting would have on additional AWIPS applications is unknown.

Solution #2:

A safer solution than editing the xorg.conf file may be turning Java offscreen pixmap support off for a particular application. Java applications that have issues using a graphic card's accelerated renderings can bypass a graphic card solution for better performance by using software only rendering. This can be done by loading the Java application with pixmap offscreen support off:

-Dsun.java2d.pmoffscreen=false

FSD has observed that by appending this option in the clientServerSync script when calling the FXC client resolved most of our performance issues.