Dear community,
I’m working on a CUDA .Net project. I want to use CUDA functions in a .Net environment for CAD tools.
My VS2017 solution file therefore contains three projects:
core.dll - main core in CUDA C/C++, target platform version 10.0.16299.0, platform toolset VS2015(v140)
bridge.dll - C++/CLI layer to expose core.dll functions to .Net, same target version, toolset VS2017(v141). .Net platform 4.5
use.dll - C# library depending on bridge.dll as the primary access point, my CAD application only calls use.dll functions
I only build 64bit atm.
System info:
Windows 10 Education
Version 1809
OS Build 17744.1003
Intel Core i7-7700K @ 4.20GHz
32 GB RAM
GPU: Nvidia GTX 1080, CUDA toolset 9.2
I have the following problem:
Until about two weeks ago everything was working very well and I had lightning fast code running. I was using Nvidia driver 388.59. Then suddenly (I think after a Windows update but not 100% sure), performance dropped significantly. My code was running 200x slower than before. I decided to update the driver to 397.64 and got my lighting fast results again. However, now the system is very unstable and I regularly get the Windows green screen of death with the exception “Kernel Security Check Failure”.
When I downgrade my driver again to 388.59 the system is stable again but painfully slow.
A few remarks:
Before the problem occured I was surprised to find out, that my code ran much much faster when I called core.dll functions from a .Net application (via bridge.dll) than when calling it from a C++ application directly referencing core.dll. I assumed the reason was that when the Common Language Runtime CLR is used, memory pointers are passed directly to the application, whereas C++ applications perform full data copies at each iteration. It seems that as soon as my problem appeared, this speed advantage of .Net was gone, unless I use a newer Nv driver, which is unstable.
My question:
Were there any major changes in how memory is exposed to Windows between driver updates 388.59 to 397.64?
How exactly is memory exposed when MSIL somes into play (I hope that’s not off-topic here)?
Thanks a lot in advance
Ben
UPDATE:
The crashes might be related to system threads. If I try to retrieve data from the GPU from a different windows thread than the normal main thread (using cudaDeviceSynchronize() and cudaStreamSynchronize() as fences), crashes seem to appear more frequently
Any information regarding the underlaying memory transfer related to C++/CLI and calling from different system threads would be helpful