kunzmi / managedCuda

ManagedCUDA aims an easy integration of NVidia's CUDA in .net applications written in C#, Visual Basic or any other .net language.
Other
440 stars 79 forks source link

cudnn and cufft #96

Open solarflarefx opened 3 years ago

solarflarefx commented 3 years ago

Are there any plans to update cudnn and cufft to CUDA 11.1? Seems they are based on older versions:

image

kunzmi commented 3 years ago

Hi,

there were no updates for cufft in Cuda 11.1 and only little in Cuda 11.0, hence no changes in managedCuda. cudnn is a different story. Nvidia releases it independently of Cuda and I haven't found the time to update for every single release. It is therefor lagging a bit behind...

Michael

solarflarefx commented 3 years ago

@kunzmi Thanks for the reply. I am not sure exactly what the root cause of my problem is but I observed the following. I am using ManagedCuda with other APIs that use CUDA. Prior to this month, I had been using CUDA 10.1 and the various APIs seemed to be working fine. But recently I tried upgrading everything to use CUDA 11.x and started having some problems with ManagedCuda. In particular the issue seems to be around CudaFFTPlan1D. In my new CUDA 11.x environment if I try releasing a CUDAFFTPlan1D object, for some reason CudaContext.Flags changes from SchedAuto to MapHost and then I have problems elsewhere in my code. This same behavior does not occur when using other APIs that use CUDA 10.1. At first I thought this could be related to not using an updated version of cuFFT. What do you think?

kunzmi commented 3 years ago

My guess is that you're not using a PrimaryContext but a standard CudaContext. When using Cuda libraries, Nvidia recommends to use the primaryContext as it is used inside the libraries and with the runtime API (managedCuda is based on the driver API). When using the standard context, with the first use of a Cuda library you actually switch to a new context without being notified, why you might see different flags being set. (To check this, you can call .SetCurrent() on your normal context, then you should have your flags being set again) I also found some new behaviour inside the Cuda libraries in this regard with version 11 onwards. Note that you have to call .SetCurrent() of the primaryContext after creation.