mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
plugin/cuda: disable CUDA plugin if /dev/nvidiactl isn't present
The presence of /dev/nvidiactl indicates that the system has a compatible NVIDIA GPU driver installed and that the GPU is accessible to the operating system. Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
parent
e1331a4b60
commit
6918998897
3 changed files with 11 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "pid.h"
|
||||
#include "proc_parse.h"
|
||||
#include "seize.h"
|
||||
#include "fault-injection.h"
|
||||
|
||||
#include <common/list.h>
|
||||
#include <compel/infect.h>
|
||||
|
|
@ -460,8 +461,15 @@ CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__RESUME_DEVICES_LATE, cuda_plugin_resume_
|
|||
|
||||
int cuda_plugin_init(int stage)
|
||||
{
|
||||
int ret = cuda_checkpoint_supports_flag("--action");
|
||||
int ret;
|
||||
|
||||
if (!fault_injected(FI_PLUGIN_CUDA_FORCE_ENABLE) && access("/dev/nvidiactl", F_OK)) {
|
||||
pr_info("/dev/nvidiactl doesn't exist. The CUDA plugin is disabled.\n");
|
||||
plugin_disabled = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = cuda_checkpoint_supports_flag("--action");
|
||||
if (ret == -1) {
|
||||
pr_warn("check that %s is present in $PATH\n", CUDA_CHECKPOINT);
|
||||
plugin_disabled = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue