Using unified memory causes system crash

The short answer is: let us not care about the pointers for the moment.
The long answer is: because they work on completely different memory spaces, so to speak, hence Njuffa’s question. :)

When using managed memory, the system needs time to migrate pages from device to host or the other way around. When trying to access a managed memory from host while the device is still doing something on it, you get a crash. That’s why cudaDeviceSynchronize() is needed after kernel or API calls that use the managed memory.

Of course. Paste here the latest code that compiles, without any more modifications, and with proper indentation, so we can see what is going on.

No, they have totally different purposes and are not interchangeable. cudaMallocManaged saves us the trouble of copying stuff between device and host as long as we take care of the synchronization. cudaMallocHost allocates “pinned” memory on the host, which I never had to use myself so I can’t comment further.

Just wanted to circle back on this. I have been trying to isolate where/when the problem occurs as relates to installed driver versions and have not had any luck. The only way I could have success was using CUDA 9.2 with older/default video drivers installed for the Intel UHD 630 and NVIDIA 1070. With the older/default (using an MSI GS65 laptop), I was not able to run 10.2 as the NVIDIA driver was not supported. Once I upgraded the NVIDIA driver (even with CUDA 9.2), then I would experience the system hang. Although I should clarify that even though the system becomes completely unresponsive to user input, and Task Manager shows 100% utilization. If there are windows open that have active content, that content continues to update. Ultimately though, the system will (in my case) first turn screen off after period of inactivity, at which point I can’t tell what it is doing and whether or not it eventually tries to go to sleep - in the end, the fans will be running at high speed and clearly the CPU and/or GPU are running HOT - with the only solution to power the system off.

Working config:
Intel driver - 24.20.100.6169 (though I did not find changing this driver to have much impact)
NVIDIA driver - 398.35
CUDA version - 9.2

Last attempt (failed) - first, I wiped system clean, and installed with Microsoft Factory Windows 10 (abandoned the MSI OEM version) -
Windows 10 1809
Intel UHD 630 Driver - 25.20.100.6373
NVIDIA 1070 GeForce Driver - 416.34
CUDA Version 10.0

NVIDIA just released 416.81 so will load that today and see if any difference.

I have encountered the same problem. Changing values via pointers (allocated with cudaMallocManaged) freezes computer. My setup is Windows 10, Cuda 9.2 with driver 416.81. Has any above suggestions fixed your problem?

Thanks,

Want to chime in that I’m experiencing the same problem. Accessing memory alloced with CudaMallocManaged used to work fine, but in some recent CUDA versions it results in freezing the whole computer. I’m reverting my code to the more manual way of managing memory now, but that’s a PITA.

Win10
Latest Nvidia drivers
GTX 1070TI
Cuda 10.0

Same here - UnifiedMemoryPerf.exe and UnifiedMemoryStreams.exe from the CUDA 10 CUDA Samples bombs out on Win10 and Geforce MX150

Bug reported:

Severity: Medium
Priority: 3 - Low

I just wanted to add that I am also suffering from this problem. On a fresh boot my code runs excellently for hours on end with no issue. If I put the computer to sleep, wake the computer, and then try to run the code I get a BSOD, KMODE_EXCEPTION_NOT_HANDLED for nvlddmkm.sys. This repeats every time I try this process.

What’s more I have several users with different nvidia cards, 1080Ti and 2080, and different versions of drivers and we all encounter the same issue.

Through various upgrades and changes I have never been able to fully isolate where this happens other than with CUDA 10 - and since there are other NVIDIA software and device driver dependencies it has not been possible to make just ‘one’ change and see if the problem can be recreated.

Driver 418.81 was released today and it may address issues like this for some users.

If you are on windows and experiencing problems with Unified Memory not working, you may wish to update to 418.81 or newer for test purposes.

Driver 418.81 appears to solve the problem for me, both of the given samples runs to completion with no immediate system crash nor instability detected afterwards (latest Win 10, Cuda 10, VS 15.9.6 and MX 150)