Skip to content

Commit 31f6f4d

Browse files
authored
Merge pull request #13016 from bosilca/v4.1/fix/13005
Protect against using CUDA without VMM support.
2 parents 23b6d34 + 9ae79b1 commit 31f6f4d

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)