cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

brandenm
Journeyman III

DISPLAY env var affecting performance

15% Performance Increase by unsetting DISPLAY

I've noticed a very odd performance change, based on the value of the DISPLAY environment variable in GPU kernels in OpenCL with the 2.2 release of the StreamSDK.

The performance of kernels is improved when the DISPLAY environment variable is unset, versus when it is set to the local X session.  This can be seen across multiple programs, including the StreamSDK examples.  See below for a demonstration by using the MatrixMulImage sample, run 1000 times, and the GFlops rating averaged across the 1000 iterations.  This is done twice, first with the DISPLAY environment variable unset, and then with the environment variable set to the local X session.

When the DISPLAY variable is unset, we average 105 GFlops.  When it is set, we only get 89 GFlops.  This appears to be restricted to GPU kernels.  No statistically significant difference was observed with when running on the CPU.

 

Can anybody explain this?

 

% env -u DISPLAY ./MatrixMulImage -i 1000 --device gpu -t | awk '/GFlops/ { SUM += $4; COUNT++;} END {print SUM/COUNT;}'
105.421

% env  DISPLAY=:0 ./MatrixMulImage -i 1000 --device gpu -t | awk '/GFlops/ { SUM += $4; COUNT++;} END {print SUM/COUNT;}'
89.4114

0 Likes
3 Replies
bananafish
Adept I

Without the DISPLAY variable set, OpenCL shouldn't be able to find your GPU(s). If no GPU can be found, the only way it could perform the calculations is by using the CPU (to date). Yet, you have `--device gpu` asserted.

 

It may be worthwhile to find out if MatrixMulImage is falling back to the CPU. How do the figures of the program running in CPU-only mode stack up to GPU-only mode with DISPLAY unset? If they are negligibly close, fallback to CPU would be a reasonable suspicion.

0 Likes

CLInfo still find GPU even without DISPLAY. IMHO it fall back to some default value. setting it to :1 for example show only CPU

second i do not see any difference between :0 :0.0 or none.

0 Likes

HI brandenm,

Could you please post your system information like following:

OS

Processor

GPU:Single GPU/MultiGPU

Catalyst Driver

--Ramandeep

 

0 Likes