Skip to content

Commit f23e5e5

Browse files
authored
Merge commit from fork
Add no-cntlibs CLI option to nvidia-container-cli
2 parents 16f37fc + 7e3642d commit f23e5e5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/cli/configure.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const struct argp configure_usage = {
3636
{"no-persistenced", 0x86, NULL, 0, "Don't include the NVIDIA persistenced socket", -1},
3737
{"no-fabricmanager", 0x87, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1},
3838
{"no-gsp-firmware", 0x88, NULL, 0, "Don't include GSP Firmware", -1},
39+
{"no-cntlibs", 0x89, NULL, 0, "Don't overwrite host mounts with CUDA compat libs from the container", -1},
3940
{0},
4041
},
4142
configure_parser,
@@ -165,6 +166,10 @@ configure_parser(int key, char *arg, struct argp_state *state)
165166
if (str_join(&err, &ctx->driver_opts, "no-gsp-firmware", " ") < 0)
166167
goto fatal;
167168
break;
169+
case 0x89:
170+
if (str_join(&err, &ctx->container_flags, "no-cntlibs", " ") < 0)
171+
goto fatal;
172+
break;
168173
case ARGP_KEY_ARG:
169174
if (state->arg_num > 0)
170175
argp_usage(state);

src/cli/list.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const struct argp list_usage = {
2525
{"no-persistenced", 0x84, NULL, 0, "Don't include the NVIDIA persistenced socket", -1},
2626
{"no-fabricmanager", 0x85, NULL, 0, "Don't include the NVIDIA fabricmanager socket", -1},
2727
{"no-gsp-firmware", 0x86, NULL, 0, "Don't include GSP Firmware", -1},
28+
{"no-cntlibs", 0x87, NULL, 0, "Don't overwrite host mounts with CUDA compat libs from the container", -1},
2829
{0},
2930
},
3031
list_parser,
@@ -86,6 +87,10 @@ list_parser(int key, char *arg, struct argp_state *state)
8687
goto fatal;
8788
ctx->list_firmwares = false;
8889
break;
90+
case 0x87:
91+
if (str_join(&err, &ctx->container_flags, "no-cntlibs", " ") < 0)
92+
goto fatal;
93+
break;
8994
case ARGP_KEY_END:
9095
if (state->argc == 1 || (state->argc == 2 && ctx->imex_channels != NULL)) {
9196
if ((ctx->devices = xstrdup(&err, "all")) == NULL)

src/nvc_container.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "xfuncs.h"
2222

2323
static char *find_namespace_path(struct error *, const struct nvc_container *, const char *);
24-
static int find_library_paths(struct error *, struct nvc_container *);
24+
static int find_compat_library_paths(struct error *, struct nvc_container *);
2525
static int lookup_owner(struct error *, struct nvc_container *);
2626
static int copy_config(struct error *, struct nvc_container *, const struct nvc_container_config *);
2727

@@ -58,7 +58,7 @@ find_namespace_path(struct error *err, const struct nvc_container *cnt, const ch
5858
}
5959

6060
static int
61-
find_library_paths(struct error *err, struct nvc_container *cnt)
61+
find_compat_library_paths(struct error *err, struct nvc_container *cnt)
6262
{
6363
char path[PATH_MAX];
6464
glob_t gl;
@@ -247,7 +247,7 @@ nvc_container_new(struct nvc_context *ctx, const struct nvc_container_config *cf
247247
if (lookup_owner(&ctx->err, cnt) < 0)
248248
goto fail;
249249
if (!(flags & OPT_NO_CNTLIBS)) {
250-
if (find_library_paths(&ctx->err, cnt) < 0)
250+
if (find_compat_library_paths(&ctx->err, cnt) < 0)
251251
goto fail;
252252
}
253253
if ((cnt->mnt_ns = find_namespace_path(&ctx->err, cnt, "mnt")) == NULL)

0 commit comments

Comments
 (0)