Thomas Unterthiner
2014-10-06 09:42:33 UTC
Hi again!
How do you completely shut down PyCUDA? After running the following lines:
from pycuda import driver as pycuda_drv
pycuda_drv.init()
device = pycuda_drv.Device(0)
ctx = device.make_context()
I can see a new process listed when using `nvidia-smi` on GPU 0 (as
expected). However, this process does not go away after:
from pycuda.tools import clear_context_caches
clear_context_caches()
ctx.pop()
# make sure the context is gone:
del(ctx)
del(device)
import gc
gc.collect()
So it seems like the context is still alive on the GPU. Grepping for
"cuCtxDestroy" in the pycuda source also yields no results. So I am
assuming the underlying cuda context is never deleted. Is this by design
(i.e., is there are reason for this), or was there just never a need to
do this before?
Cheers
Thomas
How do you completely shut down PyCUDA? After running the following lines:
from pycuda import driver as pycuda_drv
pycuda_drv.init()
device = pycuda_drv.Device(0)
ctx = device.make_context()
I can see a new process listed when using `nvidia-smi` on GPU 0 (as
expected). However, this process does not go away after:
from pycuda.tools import clear_context_caches
clear_context_caches()
ctx.pop()
# make sure the context is gone:
del(ctx)
del(device)
import gc
gc.collect()
So it seems like the context is still alive on the GPU. Grepping for
"cuCtxDestroy" in the pycuda source also yields no results. So I am
assuming the underlying cuda context is never deleted. Is this by design
(i.e., is there are reason for this), or was there just never a need to
do this before?
Cheers
Thomas