32 bit OpenCL broken with 64 bit driver 195.39

Hi There,

I’m using the new beta 195.39 driver (with OpenCL support) on a 64 bit Win7 system.
Using the 64 bit gpucomputingsdk 2.3b I can build and run 64 bit apps using OpenCL, but
32 bit apps error out. I’ve tried installing the 32 bit SDK but get the same effect and the prebuilt samples don’t run
either. I suspect the 64 bit driver doesn’t contain the required code for 32 bit apps now all the OpenCL code is moved out
of the OpenCL DLL. I’m not doing anything fancy, cust creating a context and enumerating devices.

People are going to want to run 32 bit apps against the 32 bit driver. This worked in the initial public release (with the large OpenCL.dll).

32 bit app output, OpenCL.dll below is taken from SysWOW64 directory.

‘spngTest7.exe’: Loaded ‘E:\Apps\BUSS\Simpleplot\SPNG\spngTest8\Release\spngTest7.exe’, Symbols loaded.
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\ntdll.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\kernel32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\KernelBase.dll’
‘spngTest7.exe’: Loaded ‘E:\Apps\BUSS\Simpleplot\SPNG\spngTest8\Release\stlport.5.2.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_
none_508ed732bcbc0e5a\msvcp90.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_
none_508ed732bcbc0e5a\msvcr90.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\user32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\gdi32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\lpk.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\usp10.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\msvcrt.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\advapi32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\sechost.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\rpcrt4.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\sspicli.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\cryptbase.dll’
‘spngTest7.exe’: Loaded ‘E:\Apps\BUSS\Simpleplot\SPNG\spngTest8\Release\OpenCL.dll’, Binary was not built with debug information.
‘spngTest7.exe’: Loaded ‘E:\Apps\BUSS\Simpleplot\SPNG\spngTest8\Release\GLU32.dll’, Binary was not built with debug information.
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\opengl32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\ddraw.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\dciman32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\setupapi.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\cfgmgr32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\oleaut32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\ole32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\devobj.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\dwmapi.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\imm32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\msctf.dll’
The thread ‘Win32 Thread’ (0x434) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x618) has exited with code 0 (0x0).
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\uxtheme.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\nvoglv32.dll’
The thread ‘Win32 Thread’ (0x1060) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x46c) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x738) has exited with code 0 (0x0).
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\nvcuda.dll’, Binary was not built with debug information.
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\nvapi.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\shlwapi.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\shell32.dll’
‘spngTest7.exe’: Loaded ‘C:\Windows\SysWOW64\version.dll’
First-chance exception at 0x00020001 in spngTest7.exe: 0xC0000005: Access violation reading location 0x15272ef8.
Unhandled exception at 0x00020001 in spngTest7.exe: 0xC0000005: Access violation reading location 0x15272ef8.
The program ‘[2940] spngTest7.exe: Native’ has exited with code -1073741819 (0xc0000005).

Sample code:
// OpenCL Support
cl_context hContext;
hContext = clCreateContextFromType(0, CL_DEVICE_TYPE_DEFAULT, 0, 0, 0);
if (hContext != 0)
{
size_t nContextDescriptorSize;
spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, “Created OpenCL Context:”);

		clGetContextInfo(hContext, CL_CONTEXT_DEVICES, 0, 0, &nContextDescriptorSize);
		cl_device_id * aDevices = (cl_device_id *)malloc(nContextDescriptorSize);
		if (aDevices != NULL)
		{
			if (clGetContextInfo(hContext, CL_CONTEXT_DEVICES, nContextDescriptorSize, aDevices, 0) == CL_SUCCESS)
			{
				cl_device_type devtype;
				cl_platform_id platform;
				cl_uint comp_units;
				char sDevName[256], sDevVendor[256], sDevVersion[256];
				cl_int res = clGetDeviceInfo(aDevices[0], CL_DEVICE_TYPE, sizeof(cl_device_type), &devtype, 0);
				res = clGetDeviceInfo(aDevices[0], CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, 0);
				res = clGetDeviceInfo(aDevices[0], CL_DEVICE_NAME, 255, sDevName, 0);
				sDevName[255] = '\0';
				res = clGetDeviceInfo(aDevices[0], CL_DEVICE_VENDOR, 255, sDevVendor, 0);
				sDevVendor[255] = '\0';
				res = clGetDeviceInfo(aDevices[0], CL_DEVICE_VERSION, 255, sDevVersion, 0);
				sDevVersion[255] = '\0';
				res = clGetDeviceInfo(aDevices[0], CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(cl_uint), &comp_units, 0);
				switch (devtype)
				{
				case CL_DEVICE_TYPE_CPU:
					spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "\tDeviceType=CPU");
					break;
				case CL_DEVICE_TYPE_GPU:
					spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "\tDeviceType=GPU");
					break;
				case CL_DEVICE_TYPE_ACCELERATOR:
					spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "\tDeviceType=ACCELERATOR");
					break;
				case CL_DEVICE_TYPE_DEFAULT:
					spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "\tDeviceType=DEFAULT");
					break;
				default:
					spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "\tDeviceType=UNKNOWN");
				}
				spngCString s;
				s="\tDeviceName='";
				s += sDevName;
				s += "'";
				spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, s);
				s="\tDeviceVendor='";
				s += sDevVendor;
				s += "'";
				spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, s);
				s="\tDeviceVersion='";
				s += sDevVersion;
				s += "'";
				spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, s);
				s.Format("\tNoCompUnits=%d", comp_units);
				spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, s);
			}

			free((void *)aDevices);
		}
		clReleaseContext(hContext);
	} else 
	{
		spngCDiag::pInstance()->OutputMessage(spngCDiag::INFO_, "Failed to create OpenCL context");				
	}

As point of reference I got the 32-bit, 195.39, device driver with the new shrunk down, 75 kb, openCL.DLL. I am on VISTA-32, and it runs when dynamically loaded in Java. I ordered a 64 bit Windows 7, but it has not showed up yet. If Java from Sun has a run as 32 bit command line arg like Apple, I will attempt to reproduce your problem, when the media shows up.