From 9ae79b1669fe80b22b4377a7c16bd52e1eb5521c Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 3 Jan 2025 15:13:58 -0500 Subject: [PATCH] Protect against using CUDA without VMM support. Fixes #13005. bot:notacherrypick Signed-off-by: George Bosilca --- opal/mca/common/cuda/common_cuda.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opal/mca/common/cuda/common_cuda.c b/opal/mca/common/cuda/common_cuda.c index b8ce5a7bea6..ab5177fe7f7 100644 --- a/opal/mca/common/cuda/common_cuda.c +++ b/opal/mca/common/cuda/common_cuda.c @@ -1818,6 +1818,7 @@ static int mca_common_cuda_check_mpool(CUdeviceptr dbuf, CUmemorytype *mem_type, static int mca_common_cuda_get_primary_context(CUdevice dev_id, CUcontext *pctx) { +#if OPAL_CUDA_VMM_SUPPORT CUresult result; unsigned int flags; int active; @@ -1831,7 +1832,7 @@ static int mca_common_cuda_get_primary_context(CUdevice dev_id, CUcontext *pctx) result = cuFunc.cuDevicePrimaryCtxRetain(pctx, dev_id); return OPAL_SUCCESS; } - +#endif /* OPAL_CUDA_VMM_SUPPORT */ return OPAL_ERROR; }