OpenCL: memory allocation reduces the size of available virtual memory

Good day!

I want to allocate large buffers on GPU only. My current code is as following for 2GB chunk of memory:

clCreateBuffer(context, CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_WRITE, 2 * 1024 * 1024 * 1024, nullptr, &result);

The problem is that this 2GB of memory is also allocated in VRAM! And if there is not enough memory in VRAM, my application just closed by the Windows.

My question is how to allocate memory on the GPU only without allocation in VRAM of host?

Best regards, Dmitry.

Here is a test code for reproducing the problem and a pre-compiled binary:
vram.cpp (2.6 KB)
vram.exe (258.5 KB)

And here is screenshots:
01.before_allocation

After memory allocation:
02.after_allocation