fiery

OpenCL.dll dynamic loading issues

Discussion created by fiery on Oct 24, 2009
Latest reply on Oct 26, 2009 by Sternenprinz

I'm trying to dynamically load OpenCL.dll and import procedures from it.  It works once, but doesn't work twice.  What I do basically is:

  opencldll:=LoadLibrary(opencldll_filename);
  @clgetplatformids:=GetProcAddress(opencldll,'clGetPlatformIDs');
  @clgetdeviceids  :=GetProcAddress(opencldll,'clGetDeviceIDs');
  clGetPlatformIDs...
  clGetDeviceIDs...
  FreeLibrary(opencldll);

At first I get 1 platform (ID = 0) and 2 devices (one for the GPU, other for the CPU), which is fine and correct.  At subsequent calls however, clGetDeviceIDs only returns 1 device, the CPU.  What's even more weird is that after calling that function once, the "classic" Stream layer also stops working (calInit fails).  Maybe at unloading OpenCL.dll via FreeLibrary the cleanup process is not done properly in OpenCL.dll?

I'm using Stream 2.0 Beta4 with a Radeon HD 3450 card.


Thanks,
Fiery

Outcomes