nvvp gives error: Reference to undefined variable: LMOD_SETTARG_CMD

I am running CUDA 6.5 and 7.0 on an HPC system using the lmod module system.

When the visual profiler is started. I get the following error:
Unable to profile applcation
org.eclipse.core.runtime.CoreException: Reference to undefined variable LMOD_SETTARG_CMD

Where does nvvp pick up its environment?

The application I am profiling runs by itself.