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

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

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

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

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

You need 10.2 display drivers to run SDK2.01

0 Likes

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

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

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

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

Under SDK2.0 and Catalyst 9.9, the following code worked:

cl_uint getNumPlatforms(bool fail_on_zero)
{
  cl_uint num_platforms;
  cl_int status = clGetPlatformIDs(0, NULL, &num_platforms);
  if(status != CL_SUCCESS)
          .... some error handling

 

This gives the unhandled exception error in SDK2.2 and Catalyst 10.7

 

I then tried

cl_uint getNumPlatforms(bool fail_on_zero)
{

  cl_uint num_platforms;
  cl_platform_id platforms [255];
  cl_int status = clGetPlatformIDs(255, platforms, &num_platforms);
  if(status != CL_SUCCESS)

 

I also tried

 

cl_uint getNumPlatforms(bool fail_on_zero)
{

  cl_uint num_platforms;
  cl_platform_id * platforms = new cl_platform_id [255]
  cl_int status = clGetPlatformIDs(255, platforms, &num_platforms);
  if(status != CL_SUCCESS)

This still gives the unhandled exception.

 

I think there was a middle stage where I had SDK2.2 but still was running Catalyst 9.9 , if I remember correctly. In that case, the original code still ran, but I was no longer able to find either my Firestream card or my graphics card as GPUs.

0 Likes

Originally posted by: drstrip Under SDK2.0 and Catalyst 9.9, the following code worked:

 

cl_uint getNumPlatforms(bool fail_on_zero) {   cl_uint num_platforms;   cl_int status = clGetPlatformIDs(0, NULL, &num_platforms);   if(status != CL_SUCCESS)           .... some error handling

 

 This gives the unhandled exception error in SDK2.2 and Catalyst 10.7

 

 I then tried

 

cl_uint getNumPlatforms(bool fail_on_zero) {

 

  cl_uint num_platforms;   cl_platform_id platforms [255];   cl_int status = clGetPlatformIDs(255, platforms, &num_platforms);   if(status != CL_SUCCESS)

 

 I also tried

 

 cl_uint getNumPlatforms(bool fail_on_zero) {

 

  cl_uint num_platforms;   cl_platform_id * platforms = new cl_platform_id [255]   cl_int status = clGetPlatformIDs(255, platforms, &num_platforms);   if(status != CL_SUCCESS)

 

This still gives the unhandled exception.

 

 I think there was a middle stage where I had SDK2.2 but still was running Catalyst 9.9 , if I remember correctly. In that case, the original code still ran, but I was no longer able to find either my Firestream card or my graphics card as GPUs.

 

It looks like you are using linux and did not set ICD. Please see Installation_notes doc to know how to set ICD.

0 Likes

Originally posted by: genagannaIt looks like you are using linux and did not set ICD. Please see Installation_notes doc to know how to set ICD.

 

 

Actually I'm on Windows (Vista SP2), but I'll go back and check if I missed something in the installation notes.

Checked the installation notes, nothing relevant I could find for Windows Vista to explain this. Even in the Linux case the error is a "not found" error, not an unhandled exception.

 

About all I can come up with at this point is to uninstall/install. Hopefully someone will have a more useful suggestion before I go that route.

0 Likes

I've uninstalled and reinstalled the SDK (but not the driver) and am still getting the unhandled exception.

Perhaps I need to change something in the project settings?

0 Likes

Originally posted by: drstrip I've uninstalled and reinstalled the SDK (but not the driver) and am still getting the unhandled exception.

 

Perhaps I need to change something in the project settings?

 

Could you please give more details about error? From which API you are getting this exception?

Are you able to run on CPU? 

Have you installed Nvidia SDK on your system?

0 Likes

I'm not sure what you mean "which API"? I'm using the OpenCL calls in the SDK as shown in the code I posted above in this thread.

Can I run on the CPU? No, because the error is occurring in the clGetPlatformIDs(..) call, so I can't even begin to execute a program.

 

Do I have the Nvidia SDK on my machine? No.

0 Likes

Originally posted by: drstrip I'm not sure what you mean "which API"? I'm using the OpenCL calls in the SDK as shown in the code I posted above in this thread.

 

Can I run on the CPU? No, because the error is occurring in the clGetPlatformIDs(..) call, so I can't even begin to execute a program.

 

 

Do I have the Nvidia SDK on my machine? No.

 

I mean which opencl call.  What error are you getting from clGetPlatformIDs()?

Please check whether samples picking correct OpenCL.dll or not.

0 Likes

I'm not getting an OpenCL error, I'm getting an OS unhandled exception error, as noted above.

I get the same unhandled exception error on the MatrixMultiplication example from the samples.

I also get an error linking the example straight from box - the usual libcmt/libcmtd conflicts. I checked the runtime lib settings and they both are Multi-threaded Debug, but for some reason the sdk lib builds with the non-debug runtime. If I set the MatrixMultiplication project to Multithreaded (not debug), and leave the SDK lib on debug, it compiles and links fine.

 

Summary -

Windows Vista SP2, VS2008, SDK 2.2, Catalyst 10.7
Program (mine or sample) throws unhandled exception error at clGetPlatformIDs(). No OpenCL error is returned, just an unhandled exception at the runtime level.

Have uninstalled and reinstalled SDK2.2, but not Catalyst.

 

 

0 Likes

Are you able to run CAL samples? If not then you might need to reinstall the driver -

1. Uninstall the driver, restart.

2. Use Driver Sweeper to clean files.  http://www.guru3d.com/category/driversweeper/

3. Install the driver again.

When you get the runtime error can you see the fault module name (dll name) under the program details section?

0 Likes

CAL examples also create an unhandled exception.

Module is aticfx32.dll

About to uninstall everything (including driver) and start over.

0 Likes

I've uninstalled everythingand run Driver Sweeper. I rebooted and deleted every directory I could find with ATI in it's name. I then reinstalled the 10.7 driver and SDK 2.2

I can now compile the examples and no longer get the unhandled exception. However, now it can't find my devices. I get an OpenCL error

clCreateContextFromType failed. Error code : CL_DEVICE_NOT_FOUND

I have a FireGL display card and a FireStream9270.

The FireGL card no longer appears in DeviceManager. The display adapter list has the 9270 and "Standard VGA Graphics Adapter." The display is plugged into the FireGL card and is working at 1600x1200 resolution just fine. I try to search for new hardware and the FireGL still doesn't appear.

0 Likes

you need to install the 10.7b update driver or 10.8 with SDK 2.2

0 Likes

OK, I just installed the 10.8 driver. The install log shows it recognizes the V3750FirePro card present in the unit,. I rebooted and the device manager does not showthe V3750.

I did a clean and compile on the MatrixMulitplication example and it fails with clCreateContextFromType failed. Error code : CL_DEVICE_NOT_FOUND in spite of the presence of both the V3750 and a Firestream 9270 (which is recognized by the device manager).

0 Likes

Originally posted by: drstrip OK, I just installed the 10.8 driver. The install log shows it recognizes the V3750FirePro card present in the unit,. I rebooted and the device manager does not showthe V3750.

 

I did a clean and compile on the MatrixMulitplication example and it fails with clCreateContextFromType failed. Error code : CL_DEVICE_NOT_FOUND in spite of the presence of both the V3750 and a Firestream 9270 (which is recognized by the device manager).

 

Are you able to run CAL samples?  Please run FindNumDevices sample from CAL sample.

It should display number of devices found is 2.  Driver is not installed properly if it is not 2.

0 Likes

Originally posted by: genaganna

 

 

Are you able to run CAL samples?  Please run FindNumDevices sample from CAL sample.

 

It should display number of devices found is 2.  Driver is not installed properly if it is not 2.

 

 

FindNumDevices returns 0, so apparently this means that driver is not installed properly. Thus the question becomes, how does one properly install the driver.

On this install I first uninstalled the SDK, profiler, and stream analyzer, deleted the leftover directories, uninstalled the display drivers,  and ran Driver Sweeper. I then installed the 10.8 driver, then installed the SDK, all using the Catalyst installer in express mode.

How do I install properly?

0 Likes

Originally posted by: drstrip

 

FindNumDevices returns 0, so apparently this means that driver is not installed properly. Thus the question becomes, how does one properly install the driver.

 

On this install I first uninstalled the SDK, profiler, and stream analyzer, deleted the leftover directories, uninstalled the display drivers,  and ran Driver Sweeper. I then installed the 10.8 driver, then installed the SDK, all using the Catalyst installer in express mode.

 

How do I install properly?

 

Reboot after running driver sweeper and then install driver.

0 Likes

this is getting tedious.

The V3750 does not appear under displays in device manager, so there is nothing to uninstall, I hope. The 9270 appears under displays. I select uninstall for the driver and also check delete the files. When that completes I run Driver Sweeper. As a precaution I use Driver Sweeper to analyze for nVidia drivers and only the RAID driver is found. Driver Sweeper asks to reboot cleaning ATI files, I click OK. When I reboot the 9270 still appears under the displays and driver details point to a variety of ATI*.dll files. I delete again, run Driver Sweeper, reboot. After about 4 times, I no longer see either the 9270 or the V3750, but rather two generic VGA displays. One runs some generic Windows driver (so I'm still getting 1600x1200 resolution). I run the 10.8 installer for Vista/Win 7. Install goes fine and then I reboot. Device manager lists the 9270 with ATI drivers, and a second display as a standard VGA display, still using the generic Windows driver.

 

I have also tried this sequence by first deleting the drivers, then rebooting in safe mode to run Driver Sweeper. Still the same result -

FindNumDevices is still returning 0.

This is getting frustrating and disappointing that a system that worked perfectly fine under SDK2.1 and Catalyst 9.7 has consumed hours of my time just because I tried to install the new release.

What do I need to try next? Should I physcally removethe 9270 before trying? I can't remove the 3270, otherwise I end up with no graphics adapter. Is there something else to uninstall? I'm uninstalling the display drivers by openning the device manager, selecting the display and clicking "uninstall". Is this right?

0 Likes

Originally posted by: drstrip this is getting tedious.

 

The V3750 does not appear under displays in device manager, so there is nothing to uninstall, I hope. The 9270 appears under displays. I select uninstall for the driver and also check delete the files. When that completes I run Driver Sweeper. As a precaution I use Driver Sweeper to analyze for nVidia drivers and only the RAID driver is found. Driver Sweeper asks to reboot cleaning ATI files, I click OK. When I reboot the 9270 still appears under the displays and driver details point to a variety of ATI*.dll files. I delete again, run Driver Sweeper, reboot. After about 4 times, I no longer see either the 9270 or the V3750, but rather two generic VGA displays. One runs some generic Windows driver (so I'm still getting 1600x1200 resolution). I run the 10.8 installer for Vista/Win 7. Install goes fine and then I reboot. Device manager lists the 9270 with ATI drivers, and a second display as a standard VGA display, still using the generic Windows driver.

 

 

 

I have also tried this sequence by first deleting the drivers, then rebooting in safe mode to run Driver Sweeper. Still the same result -

 

FindNumDevices is still returning 0.

 

This is getting frustrating and disappointing that a system that worked perfectly fine under SDK2.1 and Catalyst 9.7 has consumed hours of my time just because I tried to install the new release.

 

What do I need to try next? Should I physcally removethe 9270 before trying? I can't remove the 3270, otherwise I end up with no graphics adapter. Is there something else to uninstall? I'm uninstalling the display drivers by openning the device manager, selecting the display and clicking "uninstall". Is this right?

 

Please uninstall from 10.8 driver.  When you click installer, it will show two options(install and uninstall).  Please select first uninstall and remove all ATI softwares.  after that you install again.

0 Likes

I uninstalled using the Catlyst installer and reboot. I run Driver Sweeper, which finds nothing. I resinstall, reboot, still fails to find devices. Check device manager, 9270 is there, but no V3750, but a standard VGA graphics adapter running MS driver 6.0.6001.18000

I uninstall again, shut down. I physically remove the 9270 card, then boot. I then install 10.8. Install log shows V3750 device. FindNumDevices finds nothing, Device Manager shows std VFA graphics adapter running MS driver.

Uninstall via Catalyst 10.8 installer, confirm with Driver Sweeper, reboot. Run Catalyst 10.7 installer. Installer finds nothing to install, apparently it can't find the V3750 card.

This time I set msconfig to boot in safe mode, uninstall the std VGA adpater driver, and reboot into safe mode. I try to install Catalyst 10.8, but apparently you can't do this in Safe Mode, as the detection service for finding devices doesn't work.

Install again with 10.8 . Log shows it detects V3750, but apparently doesn't install driver. I run 10.8 again and try uninstall. Claims there is nothing to uninstall.

I'm lost.

0 Likes

Originally posted by: drstrip I uninstalled using the Catlyst installer and reboot. I run Driver Sweeper, which finds nothing. I resinstall, reboot, still fails to find devices. Check device manager, 9270 is there, but no V3750, but a standard VGA graphics adapter running MS driver 6.0.6001.18000

 

I uninstall again, shut down. I physically remove the 9270 card, then boot. I then install 10.8. Install log shows V3750 device. FindNumDevices finds nothing, Device Manager shows std VFA graphics adapter running MS driver.

 

Uninstall via Catalyst 10.8 installer, confirm with Driver Sweeper, reboot. Run Catalyst 10.7 installer. Installer finds nothing to install, apparently it can't find the V3750 card.

 

This time I set msconfig to boot in safe mode, uninstall the std VGA adpater driver, and reboot into safe mode. I try to install Catalyst 10.8, but apparently you can't do this in Safe Mode, as the detection service for finding devices doesn't work.

 

Install again with 10.8 . Log shows it detects V3750, but apparently doesn't install driver. I run 10.8 again and try uninstall. Claims there is nothing to uninstall.

 

I'm lost.

 

Drstrip,

          Please install 10.7b driver which resolves your issue.

0 Likes

10.7b solved the problem. Too bad nobody suggested that a week ago.

0 Likes