Skip to content

Commit

Permalink
Add no-gsp-firmware option
Browse files Browse the repository at this point in the history
This change adds a no-gsp-firmware option that skips the injection
of GSP firmware into a container.

Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Sep 17, 2024
1 parent 6b8b8e4 commit ce8844f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
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

0 comments on commit ce8844f

Please sign in to comment.