Fail to set CUexecAffinityParam

NVIDIA-SMI 495.29.05 Driver Version: 495.29.05 CUDA Version: 11.5 GPU: 2080ti
I enable mps by the following code(root):
export CUDA_VISIBLE_DEVICES=“0”
nvidia-smi -i 0 -c EXCLUSIVE_PROCESS
nvidia-cuda-mps-control -d
and nvidia-cuda-mps-server was successfully started.

then I try to set CU_EXEC_AFFINITY_TYPE_SM_COUNT by the following code:
int device = 0;
CUcontext contextPool;
CUexecAffinityParam affinity[2];
affinity[0].type = CU_EXEC_AFFINITY_TYPE_SM_COUNT;
affinity[0].param.smCount.val = (unsigned int)34;
affinity[1].type = CU_EXEC_AFFINITY_TYPE_MAX;
affinity[1].param.smCount.val = (unsigned int)34;
cuCtxCreate_v3(&contextPool, affinity, 2, 0, 0);
cudaSetDevice(device);
cudaGetDeviceProperties(&prop, device);

CUexecAffinityParam affinity_new;
cuCtxGetExecAffinity(&affinity_new, CU_EXEC_AFFINITY_TYPE_SM_COUNT);
int numSms = affinity_new.param.smCount.val;
printf("current affinity.param.smCount.val:%d\n", numSms);

cudaGetDeviceProperties(&prop, device);
int smCounts = (prop.multiProcessorCount);
printf("current prop.multiProcessorCount:%d\n", smCounts);

but I get:
current affinity.param.smCount.val:0
current prop.multiProcessorCount:68

prop.multiProcessorCount is 68 not 34.
So how should I set this value? Is the programmatic interface unavailable on 2080ti?

Does anyone know anything about cuCtxCreate_v3?

see here.

When posting code here, please format properly. A simple set of steps would be: edit your post (click pencil icon below post), then select all code, then click the </> button at the top of the edit window, then save changes.

The hyperlink is broken?

fixed