I'm using numpy-sharedmem <https://bitbucket.org/cleemesser/numpy-sharedmem>
to allocate shared memory array across multiple cpu processes. However,
after page locking it with register_host_memory, the shared memory is never
cleared at exit. Below is a minimal example of this behavior on Ubuntu
16.04, python 2.7.12  and pycuda 2016.1.2:

import sharedmem
import numpy as np
from pycuda import autoinit
import pycuda.driver as driver

arr = sharedmem.zeros(10 ** 8, dtype=np.float32)
arr = driver.register_host_memory(arr,

At exit, this shared memory array is not cleared. Unregistering the
pagelocked memory beforehand doesn't work either.

Also, I noticed that RegisteredHostMemory instance in arr.base, which
according to the documentation
should have base attribute containing the original array, doesn't actually
have it.

Is there a manual way of clearing this shared memory in pycuda that I'm

Thanks in advance,
PyCUDA mailing list

Reply via email to