Skip to content

Commit f31e94d

Browse files
Chuck Fosseniziemba
authored andcommitted
hmem/cuda: Add env variable to enable/disable CUDA DMABUF
Enabled by default Signed-off-by: Chuck Fossen <[email protected]>
1 parent ae01547 commit f31e94d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/hmem_cuda.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,9 @@ int cuda_hmem_init(void)
763763
"If libfabric is not compiled with gdrcopy support, "
764764
"this variable is not checked. (default: true)");
765765

766+
fi_param_define(NULL, "hmem_cuda_use_dmabuf", FI_PARAM_BOOL,
767+
"Use dma-buf for sharing buffer with hardware. (default:true)");
768+
766769
ret = cuda_hmem_dl_init();
767770
if (ret != FI_SUCCESS)
768771
return ret;
@@ -936,7 +939,11 @@ bool cuda_is_gdrcopy_enabled(void)
936939

937940
bool cuda_is_dmabuf_supported(void)
938941
{
939-
return cuda_attr.dmabuf_supported;
942+
int use_dmabuf = 1;
943+
944+
fi_param_get_bool(NULL, "hmem_cuda_use_dmabuf", &use_dmabuf);
945+
946+
return use_dmabuf && cuda_attr.dmabuf_supported;
940947
}
941948

942949
#else

0 commit comments

Comments
 (0)