cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ryujakk
Journeyman III

access violation error when running OpenCL sample examples

Unhandled exception at 0x00000000 in MatrixMultiplication.exe: 0xC0000005: Access violation.

Hi,

I want to get started with OpenCL, but I am happy trouble setting up the basics. I get an "access violation error" whenever I try to run a sample example in Visual Studio. I've narrowed it down to the "clGetPlatformIDs" function that appears in:

    cl_uint numPlatforms;
    cl_platform_id platform = NULL;
    status = clGetPlatformIDs(0, NULL, &numPlatforms);

 

I've searched extensively for similar problems, but did not find anything pertinent... I've also completely uninstalled all ATI drivers to have a clean install, but that did not help either!

Here is my config: (I'll gladly give more if it can be of any help!)

- Sony VAIO fw laptop, with Windows 7 x64 and Mobility Radeon HD 4650

- Catalyst control center 2010.0202.2335.42270

- Radeon HD 4650 Driver 8.650.0.0

- Microsoft Visual Studio 2008, Version 9.2.210228 RTM

Thank you!

0 Likes
30 Replies
n0thing
Journeyman III

access violation error when running OpenCL sample examples

You cannot pass a NULL platform in functions due to ICD changes.

See this - http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71

 

0 Likes
ryujakk
Journeyman III

access violation error when running OpenCL sample examples

Thanks for the link, but I already have the 2.1 SDK with the updated examples. At least I suppose they are updated since they follow the guidelines posted in your link. So I don't think that's the source of my problem unfortunately!

0 Likes
omkaranathan
Journeyman III

access violation error when running OpenCL sample examples

ryujakk,

Did you install Catalyst 10.2 Driver only? Are you able to run CAL samples? Could you please post the output of CAL sample 'FindNumDevices' and OpenCL sample 'Template'?

0 Likes
ryujakk
Journeyman III

access violation error when running OpenCL sample examples

omkarananthan,

I have the Catalyst Control Center 10.2 which I got from http://game.amd.com/us-en/drivers_catalyst.aspx?p=win7/windows-7-64bit. First download link, "Catalyst Software Suite (64 bit) English Only"

I got the driver from http://support.amd.com/us/gpudownload/windows/Pages/radeonmob_win7-64.aspx

Since my card is a Mobility, I could not install the driver from the CCC 10.2.

 

When I run FindNumDevices, I get:

'FindNumDevices.exe': Loaded 'K:\Users\MyName\workspace\ATI Samples\samples\cal\tutorial\FindNumDevices\Debug\FindNumDevices.exe', Symbols loaded.
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\aticalrt.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\aticalcl.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\aticaldd.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'FindNumDevices.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll'
First-chance exception at 0x00000000 in FindNumDevices.exe: 0xC0000005: Access violation.
Unhandled exception at 0x00000000 in FindNumDevices.exe: 0xC0000005: Access violation reading location 0x00000000.

Quite the same as running Template:

'Template.exe': Loaded 'K:\Users\MyName\workspace\ATI Samples\samples\opencl\bin\debug\x86\Template.exe', Symbols loaded.
'Template.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\OpenCL.dll', Binary was not built with debug information.
'Template.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll'
'Template.exe': Loaded 'C:\Program Files (x86)\ATI Stream\bin\x86\atiocl.dll', Binary was not built with debug information.
'Template.exe': Loaded 'C:\Windows\SysWOW64\dbghelp.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\aticaldd.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'Template.exe': Loaded 'C:\Windows\SysWOW64\atigktxx.dll'
First-chance exception at 0x00000000 in Template.exe: 0xC0000005: Access violation.
Unhandled exception at 0x00000000 in Template.exe: 0xC0000005: Access violation.

There you go...

0 Likes
omkaranathan
Journeyman III

access violation error when running OpenCL sample examples

You need 10.2 display drivers to run SDK2.01

0 Likes
ryujakk
Journeyman III

access violation error when running OpenCL sample examples

Okay. Any idea where I can get them for my video card? The Moblility Radeon HD4650 is supposed to compatible according to http://developer.amd.com/gpu/ATIStreamSDK/Pages/default.aspx

Edit: I followed the tutorial here: http://www.steelfrog.com/how-to-modify-and-install-ati-drivers-on-your-laptop/ and managed to successfully install the latest drivers. The OpenCL samples now work as expected!

0 Likes
n0thing
Journeyman III

access violation error when running OpenCL sample examples

FYI, the Catalyst 10.3 is going to support mobile GPUs for Vista and Windows7.  

Read this - http://techgage.com/article/a_look_at_atis_catalyst_102_103_drivers/

 

0 Likes
drstrip
Journeyman III

access violation error when running OpenCL sample examples

I'm having this exact same problem on some code I've written. The problems started when I updated to the 2.2 SDK and 10.7 Catalyst driver.

I looked at the knowledgebase article cited above. That article actually shows clGetPlatformIDs being called with a NULL for the pointer to platform ids in order to return number of platforms, contrary to what is stated above. Regardless of that, I tried calling with a non-NULL value (after allocating memory for the values) and still got the unhandled exception error. I've done a "clean" and build on the programs since updating the SDK, so I don't think I'm linked to old libs.

0 Likes
genaganna
Journeyman III

access violation error when running OpenCL sample examples

Originally posted by: drstrip I'm having this exact same problem on some code I've written. The problems started when I updated to the 2.2 SDK and 10.7 Catalyst driver.

 

I looked at the knowledgebase article cited above. That article actually shows clGetPlatformIDs being called with a NULL for the pointer to platform ids in order to return number of platforms, contrary to what is stated above. Regardless of that, I tried calling with a non-NULL value (after allocating memory for the values) and still got the unhandled exception error. I've done a "clean" and build on the programs since updating the SDK, so I don't think I'm linked to old libs.

 

Could you please post your code here so that we can tell you what is wrong with your code?

Which SDK were you using previously?

0 Likes