This project is read-only.

AccessViolationException in CudafyHost.GetDevice method!

Nov 20, 2013 at 2:59 AM
When execute the line
CudafyHost.GetDevice(eArchitecture.OpenCL, CudafyModes.DeviceId);
throw the exception:

Unhandled exception: System.TypeInitializationException: The type initializer for 'Cudafy.Host.OpenCLDevice' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Cloo.ComputePlatform' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
in Cloo.Bindings.CL10.GetPlatformIDs(Int32 num_entries, CLPlatformHandle[] platforms, Int32& num_platforms)
in Cloo.ComputePlatform..cctor()
--- End of inner exception stack trace ---
in Cloo.ComputePlatform.get_Platforms()
in Cudafy.Host.OpenCLDevice..cctor()
--- End of inner exception stack trace ---
in Cudafy.Host.OpenCLDevice..ctor(Int32 deviceId)
in Cudafy.Host.CudafyHost.DoCreateDevice(eGPUType target, Int32 deviceId)
in Cudafy.Host.CudafyHost.CreateDevice(eGPUType type, Int32 deviceId)
in Cudafy.Host.CudafyHost.GetDevice(eGPUType type, Int32 deviceId)
in HighDE.Core.CudafyTest.HelloWorld(String[] args)
in HighDE.App.Program.Main(String[] args)

Why??? Somebody can help me?
Dec 5, 2013 at 8:33 AM
Silly question but you do have an OpenCL SDK installed?
Dec 5, 2013 at 11:46 AM
Hi NickKopp, yes, I had all necessary installed and more, and this was the problem. The problem had begins after I install other amd drivers and sdk's. The post How to Enable OpenCL Support on NVIDIA and AMD Platforms showed me the solution! I remove all sdk's and all drivers and reinstall only the necessary, then it work fine. I think that the exception raised was not clear, I only suspect about drivers after debug the framework. But, all right, cudafy is a great framework, congratulations for all.

Thanks!