cuCtxCreate Problem on P4000

Hi:
I use the following code to create context on P4000,but I just can get 20+ contexts.

void test(){
CUresult result = 0;
int gpuCount;
cuInit( 0 );
CUdevice dev;
cuDeviceGet( &dev, 0 );
CUcontext context[25];
for (int i = 0; i < 25; i=i+1) {
result = cuCtxCreate( &context[i], CU_CTX_SCHED_AUTO, dev );
size_t free=0, total=0;
cuMemGetInfo( &free, &total);
printf( “free=%ld total=%ld i=%d status=%d\n”, free, total ,i,result);
}
printf( “\n” );
}

output:
free=8409251840 total=8506769408 i=0 status=0
free=8322220032 total=8506769408 i=1 status=0
free=8235188224 total=8506769408 i=2 status=0
free=8148156416 total=8506769408 i=3 status=0
free=8061124608 total=8506769408 i=4 status=0
free=7974092800 total=8506769408 i=5 status=0
free=7887060992 total=8506769408 i=6 status=0
free=7800029184 total=8506769408 i=7 status=0
free=7710900224 total=8506769408 i=8 status=0
free=7623868416 total=8506769408 i=9 status=0
free=7536836608 total=8506769408 i=10 status=0
free=7449804800 total=8506769408 i=11 status=0
free=7362772992 total=8506769408 i=12 status=0
free=7275741184 total=8506769408 i=13 status=0
free=7188709376 total=8506769408 i=14 status=0
free=7101677568 total=8506769408 i=15 status=0
free=7012548608 total=8506769408 i=16 status=0
free=6925516800 total=8506769408 i=17 status=0
free=6838484992 total=8506769408 i=18 status=0
free=6751453184 total=8506769408 i=19 status=0
free=6664421376 total=8506769408 i=20 status=0
free=6577389568 total=8506769408 i=21 status=0
free=6577389568 total=8506769408 i=22 status=2 <= failed ,because out of memoty
free=6577389568 total=8506769408 i=23 status=2
free=6577389568 total=8506769408 i=24 status=2

sudo nvidia-smi
Mon Sep 4 00:00:48 2017
±----------------------------------------------------------------------------+
| NVIDIA-SMI 384.69 Driver Version: 384.69 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P4000 Off | 00000000:01:00.0 Off | N/A |
| 48% 45C P0 28W / 105W | 1840MiB / 8112MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 16684 C ./a.out 1826MiB |
±----------------------------------------------------------------------------+
It still have enough memory
Why?

It looks like the same problem as
https://devtalk.nvidia.com/default/topic/1020110/video-technologies/cuctxcreate-problem-on-p5000/

Thaks