AMD's OpenCL driver has an issue with its use of temporary files.
The driver creates temporary files, such as
It looks like one or more of these temporary files is created per kernel compilation.
They don't seem to be cleaned up however.
The general format for the filename seems to be OCLXXXX, where the Xs are hexadecimal characters.
This gives 16^4 = 65536 possible temp file names.
Once that order of kernel executions have been done, most or all of the possible temporary files have been created.
When this happens, the driver seems to do a sequential search through the available filenames, looking for a free filename. This causes an extreme slowdown
of kernel compilation/build. A kernel that used to take 0.05s now takes ~4s.
I have a screenshot from process monitor that pretty much summarises the problem. You can see that a linear search is done through filenames on the temp filesystem, looking for a free filename.
AMD Catalyst Control Center Version: 2015.0804.21.41908
Catalyst Version: 15.7.1