This project is read-only.

AccessViolationException was unhandled in enum_gpu example Cudafy 1.11

Nov 1, 2012 at 5:37 PM
Edited Nov 1, 2012 at 5:37 PM

Just installed Cuda 5 and tried to run the cudafyByExample program from CUdafy 1.11.


foreach (GPGPUProperties prop in CudafyHost.GetDeviceProperties(CudafyModes


System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
       at System.StubHelpers.StubHelpers.DestroyCleanupList(CleanupWorkList& pCleanupWorkList)
       at GASS.CUDA.CUDARuntime64.cudaGetDeviceProperties(cudaDeviceProp& prop, Int32 device)
       at GASS.CUDA.CUDARuntime64.GetDeviceProperties(cudaDeviceProp& prop, Int32 device)
       at Cudafy.Host.CudaGPU.GetDeviceProperties(Boolean useAdvanced)
       at Cudafy.Host.CudafyHost.<GetDeviceProperties>d__2.MoveNext()
       at CudafyByExample.enum_gpu.Execute() in C:\Users\cblanke\Desktop\CudafyV1.11\CudafyByExample\chapter03\enum_gpu.cs:line 22
       at CudafyByExample.Program.Main(String[] args) in C:\Users\cblanke\Desktop\CudafyV1.11\CudafyByExample\Program.cs:line 36


 in the enum_gpu a exception is thrown:

while attempting

Nov 1, 2012 at 7:40 PM

Do simple_kernel_params and simple_kernel run successfully?

What happens if you pass false as a second argument? - i.e. GetDeviceProperties(CudafyModes.Target, false)

Can you give version of CUDA 5.0 and your OS details?


Nov 1, 2012 at 7:54 PM
Edited Nov 1, 2012 at 7:54 PM

Hi Nick,


simple_kernel_params and simple_kernel ran successfully.

I have added false as second argument. This solved the problem.

I am running 5.0.35 on Windows 7 SP1 64bit.





Nov 1, 2012 at 10:45 PM

That's the same issue I reported here:

Passing false as a second argument results in an assumption of a lower compute capability, and exteneded properties are not returned. The same issue will occur in two more examples. I found that copying cudart32_50_27.dll and cudart64_50_35.dll to corresponding ..._27.dll provided full functionality without changing the arguments to GetProperties().



Nov 2, 2012 at 11:56 AM

Okay there appears to have been changes to the layout of the device properties struct used by CUDA.  This has been amended in the sources, so if you build you should have it working.  A new official release will be made shortly since this is a bit of a nasty one, although it did not cause major issues on our test machines for some reason.