cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bgoglin
Journeyman III

Why is OpenCL startup so slow?

Hello,

We have a Linux (3.2) server with two Radeon 7970 and Catalyst 12.10. OpenCL takes more than a second to start. Basically the first OpenCL call, usually clGetPlatformIDs() takes 1.25s. All the following OpenCL calls in the same process are OK. If I start another process later, same behavior.

clinfo gets the same overheads.

If I change the COMPUTE environment variable to use a single GPU. The overhead goes down to about 1.00s. If I ignore both GPUs, the overhead disappears. It looks like the driver spends a lot of time initializing GPU device things (especially for the first GPU) on the first OpenCL call.

Is there a way to improve this? On NVIDIA, they have a "persistent" mode to make sure that the driver doesn't have to reinit the devices everytime. Is there anything similar for Catalyst? Actually, there's a X server running on the machine so the GPU isn't idle between my OpenCL processes (the NVIDIA persistent mode isn't needed if a X server is running).

FWIW, I am porting hwloc over OpenCL and I would rather not waste 1 second when only listing the server topology.

thanks

Brice

0 Likes
4 Replies
binying
Challenger

Opencl startup is 10X faster on my pc.   It is Win7 though.

Would it be better if you use the latest driver?

0 Likes
yurtesen
Miniboss

I never had 1 second delay on any machine with clinfo. Are you running i remotely or locally? and X is running?

0 Likes

This is a HPC server, I am running remotely. I would like to avoid running X but it didn't find anyway to do so, so yes X is running.

0 Likes

Hmmm, it looks like this is related to DISPLAY and COMPUTE environment variables. We only set COMPUTE=:0 because forcing DISPLAY=:0 is annoying for ssh users (i.e. everybody on this machine).

With COMPUTE=:0, clinfo takes about 1.24s

With DISPLAY=:0 clinfo takes about 0.56s

The documentation seems to say that setting COMPUTE should be enough, but the above tends to say that not forcing DISPLAY still causes OpenCL to connect to the remote X server.

0 Likes