Exception running CudafyByExample: Unable to load DLL 'cudart32_50_27'

Oct 30, 2012 at 12:25 AM
Edited Oct 30, 2012 at 12:27 AM

I am getting the error at three locations in CudafyByExample.

  1. enum_gpu.Execute();
  2. hist_gpu_shmem_atomics.Execute(0;
  3. new copy_timed().Execute;

I am running the 5.0 download of CUDA, and have cudart32_50_35.dll on my system.

System.DllNotFoundException: Unable to load DLL 'cudart32_50_27': The specified module could not be found. (Exception from HRESULT:
   at GASS.CUDA.CUDARuntime32.cudaGetDeviceProperties(cudaDeviceProp& prop, Int32 device)
   at GASS.CUDA.CUDARuntime32.GetDeviceProperties(cudaDeviceProp& prop, Int32 device)
   at Cudafy.Host.CudaGPU.GetDeviceProperties(Boolean useAdvanced)
   at Cudafy.Host.CudafyHost.d__2.MoveNext()
   at CudafyByExample.enum_gpu.Execute() in C:\Users\Pieter_2\Documents\Visual Studio 2010\3rd Party Tools\CudaFy\CudafyV1.10\Cudafy
ByExample\chapter03\enum_gpu.cs:line 22
   at CudafyByExample.Program.Main(String[] args) in C:\Users\Pieter_2\Documents\Visual Studio 2010\3rd Party Tools\CudaFy\CudafyV1.
10\CudafyByExample\Program.cs:line 39

[edit] I downloaded the most recent version of Cudafy (I thought) yesterday, right after downloading CUDA 5.0.

Any thoughts?


Oct 30, 2012 at 1:01 AM

In all three instances, the error is in the call of gpu.GetDeviceProperties(); by changing the calls to  gpu.GetDeviceProperties(false) the Exceptions disappeared.


Oct 30, 2012 at 8:41 AM

Yes you have a mismatch between the version of CUDA and CUDAfy you have on your machine.  gpu.GetDeviceProperties(false) does NOT use the cudart dll whereas passing true does use it to get additional properties.  Since cudart dll includes the version number it does not find it and hence you get this error.


Oct 30, 2012 at 2:02 PM
Edited Oct 30, 2012 at 2:24 PM

Yes, I took a gander at CUDARuntime.cs.  I thought to implement a dynamic name lookup replacement for that module, but a build won't run until I track down where to define required pre-processor constants: NET_4_0, FULL_AST, maybe more I haven't stumbled over yet.  I'm still learning new to C#, and haven't tackled multi-platform building yet.

[edit] Actually, that would be too clever by half, as this should be user-controllable. Ideally a little app would allow the user to select which installed version of drivers to target. However I cannot readily find where NVidia stores this information, if indeed they do, other than in the DLL filenames.

It must be stored somewher though, as it is visible in ControlPanel -> Programs and Features.