Skip to content

Commit

Permalink
Initializations sets Cuda device to main Cuda device
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLevy committed Dec 1, 2024
1 parent 5f0188b commit 66e787d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/geogram/NL/nl_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,10 @@ NLboolean nlInitExtension_CUDA(void) {
find_cusparse_func_quiet(cusparseSpMV_preprocess);
find_cusparse_func_quiet(cusparseCreateConstCsr);

if(!nlExtensionIsInitialized_CUDA()) {
return NL_FALSE;
}

if(CUDA()->cusparseCreateConstCsr != NULL) {
nl_printf("OpenNL CUDA: has cusparseCreateConstCsr()\n");
} else {
Expand Down Expand Up @@ -1265,16 +1269,14 @@ NLboolean nlInitExtension_CUDA(void) {
)
);
if(can_access_peer) {
nl_printf("OpenNL CUDA[%d]: can access peer", dev_id);
nl_printf("OpenNL CUDA[%d]: can access peer\n", dev_id);
} else {
nl_printf("OpenNL CUDA[%d]: cannot access peer", dev_id);
nl_printf("OpenNL CUDA[%d]: cannot access peer\n", dev_id);
}
}
}

if(!nlExtensionIsInitialized_CUDA()) {
return NL_FALSE;
}
nlCUDACheck(CUDA()->cudaSetDevice(main_dev_id));

nlCUDACheck(
CUDA()->cublasGetVersion(
Expand Down

0 comments on commit 66e787d

Please sign in to comment.