Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-gsp-firmware-option to skip injection of GSP firmware #284

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cli/configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const struct argp configure_usage = {
{"no-devbind", 0x85, NULL, 0, "Don't bind mount devices", -1},
{"no-persistenced", 0x86, NULL, 0, "Don't include the NVIDIA persistenced socket", -1},
{"no-fabricmanager", 0x87, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1},
{"no-gsp-firmware", 0x88, NULL, 0, "Don't include GSP Firmware", -1},
{0},
},
configure_parser,
Expand Down Expand Up @@ -160,6 +161,10 @@ configure_parser(int key, char *arg, struct argp_state *state)
if (str_join(&err, &ctx->driver_opts, "no-fabricmanager", " ") < 0)
goto fatal;
break;
case 0x88:
if (str_join(&err, &ctx->driver_opts, "no-gsp-firmware", " ") < 0)
goto fatal;
break;
case ARGP_KEY_ARG:
if (state->arg_num > 0)
argp_usage(state);
Expand Down
6 changes: 6 additions & 0 deletions src/cli/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const struct argp list_usage = {
{"imex-channel", 0x83, "CHANNEL", 0, "IMEX channel ID(s) to inject", -1},
{"no-persistenced", 0x84, NULL, 0, "Don't include the NVIDIA persistenced socket", -1},
{"no-fabricmanager", 0x85, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1},
{"no-gsp-firmware", 0x86, NULL, 0, "Don't include GSP Firmware", -1},
{0},
},
list_parser,
Expand Down Expand Up @@ -80,6 +81,11 @@ list_parser(int key, char *arg, struct argp_state *state)
if (str_join(&err, &ctx->driver_opts, "no-fabricmanager", " ") < 0)
goto fatal;
break;
case 0x86:
if (str_join(&err, &ctx->driver_opts, "no-gsp-firmware", " ") < 0)
goto fatal;
ctx->list_firmwares = false;
break;
case ARGP_KEY_END:
if (state->argc == 1 || (state->argc == 2 && ctx->imex_channels != NULL)) {
if ((ctx->devices = xstrdup(&err, "all")) == NULL)
Expand Down
8 changes: 5 additions & 3 deletions src/nvc_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@ lookup_paths(struct error *err, struct dxcore_context *dxcore, struct nvc_driver
return (-1);
}

if (lookup_firmwares(err, dxcore, info, root, flags) < 0) {
log_err("error looking up additional paths");
return (-1);
if (!(flags & OPT_NO_GSP_FIRMWARE)) {
if (lookup_firmwares(err, dxcore, info, root, flags) < 0) {
log_err("error looking up additional paths");
return (-1);
}
}

return (0);
Expand Down
2 changes: 2 additions & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum {
OPT_NO_MPS = 1 << 3,
OPT_NO_PERSISTENCED = 1 << 4,
OPT_NO_FABRICMANAGER = 1 << 5,
OPT_NO_GSP_FIRMWARE = 1 << 6,
};

static const struct option driver_opts[] = {
Expand All @@ -42,6 +43,7 @@ static const struct option driver_opts[] = {
{"no-mps", OPT_NO_MPS},
{"no-persistenced", OPT_NO_PERSISTENCED},
{"no-fabricmanager", OPT_NO_FABRICMANAGER},
{"no-gsp-firmware", OPT_NO_GSP_FIRMWARE},
};

static const char * const default_driver_opts = "";
Expand Down