Skip to content

Commit 9ae79b1

Browse files
committed
Protect against using CUDA without VMM support.
Fixes #13005. bot:notacherrypick Signed-off-by: George Bosilca <[email protected]>
1 parent 23b6d34 commit 9ae79b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opal/mca/common/cuda/common_cuda.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,7 @@ static int mca_common_cuda_check_mpool(CUdeviceptr dbuf, CUmemorytype *mem_type,
18181818

18191819
static int mca_common_cuda_get_primary_context(CUdevice dev_id, CUcontext *pctx)
18201820
{
1821+
#if OPAL_CUDA_VMM_SUPPORT
18211822
CUresult result;
18221823
unsigned int flags;
18231824
int active;
@@ -1831,7 +1832,7 @@ static int mca_common_cuda_get_primary_context(CUdevice dev_id, CUcontext *pctx)
18311832
result = cuFunc.cuDevicePrimaryCtxRetain(pctx, dev_id);
18321833
return OPAL_SUCCESS;
18331834
}
1834-
1835+
#endif /* OPAL_CUDA_VMM_SUPPORT */
18351836
return OPAL_ERROR;
18361837
}
18371838

0 commit comments

Comments
 (0)