I used LD_PRELOAD and customized cuMemGetInfo function:
BlockquoteCUresult cuMemGetInfo(size_t *free, size_t *total) {
size_t used = 0;
// if (g_vcuda_config.enable) {
// atomic_action(pid_path, get_used_gpu_memory, (void *)&used);
*total = 2147483648;
*free = 2147483648;
return CUDA_SUCCESS;
// }
// return CUDA_ENTRY_CALL(cuda_library_entry, cuMemGetInfo, free, total);
}
But it doesn’t work. The application still return correct device memory, not modified.