I have exactly the same problem that was asked 8 and 9 years ago (!) in error when copying dynamically allocated data in device to host? and CUDA - Copy device data to host?