When cuda driver will be unloaded in cuda program?

I got an error because of calling cudaFreeHost after cuda driver unloaded.
so, i want know when cuda driver is unloaded in cuda project.
i am developing c project in visual studio.

did you call cudaFreeHost in a destructor?


Perhaps your destructor is also part of a class that is defined outside of main (static or at global scope)
Generally that can be troublesome.

Read here:


Thanks for you help.
I will investigate more.