CUDA large vectors cause errors

I’m trying to copy some memory over to the device, but I’m having some trouble with larger vectors, the following vectors works perfectly:

thrust::device_vector<unsigned int> data = std::vector<unsigned int>(115200); // smaller size

But this one does not:

thrust::device_vector<unsigned int> data = std::vector<unsigned int>(1152000); // (roughly 5 MB worth of data)

When I get a pointer from the larger vector (thrust::raw_pointer_cast) and use it in a kernel like this I get an access violation error after the kernel finishes running, the smaller vector works just fine.

__global__ void Kernel(unsigned int* data) {
    printf("%u\n", data[0]);

Is there perhaps a size limit on device vectors, or is the size type overflowing?
Any advice is greatly appreciated!

The only size limited on vector will be the available global memory available on device.
It’s much easier to help you if you provide an entire sample.

Hey, I’ve done some dug around in my code base, and found out that the error is being caused by something a bit different, I’ve also created a minimal viable example to showcase the behavior of my code. The new question can be found here. Regards