OpenCL recompile problem

Hi… I’m Korean. (so I’m poor at English)…

I did write OpenCL program and tested in Windows XP ( Visual Studio 2010 )

When I edit cl source and restart my program, result is not change. ( only view old version’s result )

I find same problem in MacOS X. but, in Mac, easy to solve this as type ‘kill all cvmsServ’…

How can I solve this problem… It may clCreateProgramWithSource function has cached…

I had a similar problem too. I suspect the OpenCL kernels are pre-compiled into some kind of binary blob cache by the driver.

NVIDIA should really add a compiler option to avoid this behavior because a lot of programmers are using the -nv-verbose option to see how many registers their kernels are using but, if the kernels are cached, the log’s text won’t show the info.

ldk, can you can post sample code that reproduces the problem?

On Linux the driver caches compiled kernels in ~/.nv/ComputeCache. Deleting this folder forces a recompile.

Changing the source code does not guarantee a recompile as the cache hash is from the PTX source, so if you just add a extra line or a space to invalidate the cache it won’t work.

The easiest way to tell if your code is being read from cache or actually being compiled is to use the NVIDIA compile flag extension -cl-nv-verbose and read the build log. If is is compiled then PTXAS will return the register count and shared memory usage. If it is cached you will not get this line.

I am not sure on Windows where the cache is stored, FileMon might help you there.