In the first call cuda.mem_alloc allocated the memory in the GPU but in the second call, cuda.mem_alloc did not allocate as you can see below. Both the calls are being from the same cell in the jupyter notebook can anyone explain the reason behind this?
import numpy as np
#PyCUDA imports
import pycuda.driver as cuda
import pycuda.autoinit
#####################first call###############
print(cuda.mem_get_info()) #(16608854016, 17062100992)
distances = np.zeros(shape = 6, dtype = np.float32)
distances_gpu = cuda.mem_alloc(distances.nbytes)
print(cuda.mem_get_info()) #(16606756864, 17062100992)
#####################second call###############
print(cuda.mem_get_info()) #(16606756864, 17062100992)
d = np.zeros(shape = 6, dtype = np.float32)
d1 = cuda.mem_alloc(d.nbytes)
print(cuda.mem_get_info()) #(16606756864, 17062100992)