Skip to content

Commit

Permalink
Nvidia GPUs: Call nvmlInit() once (state-preservation)
Browse files Browse the repository at this point in the history
  • Loading branch information
amarathe84 committed Jul 7, 2023
1 parent 6ea2644 commit c897425
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/variorum/Nvidia_GPU/config_nvidia.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ uint64_t *detect_gpu_arch(void)

int set_nvidia_func_ptrs(int idx)
{
static int init_complete = 0;
int err = 0;

if (*g_platform[idx].arch_id == VOLTA)
Expand All @@ -39,6 +40,10 @@ int set_nvidia_func_ptrs(int idx)
err = VARIORUM_ERROR_UNSUPPORTED_PLATFORM;
}

initNVML();
if (init_complete == 0)
{
initNVML();
init_complete = 1;
}
return err;
}

0 comments on commit c897425

Please sign in to comment.