Skip to content

Commit caf057b

Browse files
authored
Merge pull request #311 from elezar/bugfix-enroot
Add additional logging
2 parents ebabd2a + 4ac868a commit caf057b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/cli/compat_mode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ update_compat_libraries(struct nvc_context *ctx, struct nvc_container *cnt, cons
4040
}
4141

4242
/* For cuda-compat-mode=mount, we also allow compat libraries with a LOWER major versions. */
43-
bool allow_lower_major_versions = (cnt-> flags & OPT_CUDA_COMPAT_MODE_MOUNT);
43+
bool allow_lower_major_versions = (cnt->flags & OPT_CUDA_COMPAT_MODE_MOUNT);
4444
filter_by_major_version(allow_lower_major_versions, info, libs, &nlibs);
4545

4646
/* Use the filtered library list. */
@@ -55,6 +55,7 @@ update_compat_libraries(struct nvc_context *ctx, struct nvc_container *cnt, cons
5555
if (get_compat_library_path(&ctx->err, (const char **)libs, nlibs, &cnt->cuda_compat_dir) < 0) {
5656
return (-1);
5757
}
58+
log_infof("setting CUDA Forward Compatibility directory to %s", cnt->cuda_compat_dir);
5859
return (0);
5960
}
6061

src/nvc_container.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,11 @@ nvc_container_new(struct nvc_context *ctx, const struct nvc_container_config *cf
241241
return (NULL);
242242
}
243243

244-
log_infof("configuring container with '%s'", opts);
244+
log_infof("configuring container with '%s' (flags: 0x%08x)", opts, flags);
245245
if ((cnt = xcalloc(&ctx->err, 1, sizeof(*cnt))) == NULL)
246246
return (NULL);
247247

248+
cnt->cuda_compat_dir = NULL;
248249
cnt->flags = flags;
249250
if (copy_config(&ctx->err, cnt, cfg) < 0)
250251
goto fail;
@@ -316,6 +317,7 @@ validate_cuda_compat_mode_flags(struct error *err, int32_t *flags) {
316317
* If the OPT_CUDA_COMPAT_MODE_DISABLED flag is specified, we
317318
* explicitly ignore other OP_CUDA_COMPAT_MODE_* flags.
318319
*/
320+
log_info("disabling CUDA Forward Compatibility");
319321
*flags &= ~(OPT_CUDA_COMPAT_MODE_MOUNT | OPT_CUDA_COMPAT_MODE_LDCONFIG);
320322
return (0);
321323
}
@@ -325,6 +327,7 @@ validate_cuda_compat_mode_flags(struct error *err, int32_t *flags) {
325327
* default to OPT_CUDA_COMPAT_MODE_MOUNT to maintain
326328
* backward compatibility.
327329
*/
330+
log_info("defaulting to cuda-compat-mode=mount");
328331
*flags |= OPT_CUDA_COMPAT_MODE_MOUNT;
329332
return (0);
330333
}

src/nvc_ldcache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,15 @@ nvc_ldcache_update(struct nvc_context *ctx, const struct nvc_container *cnt)
472472
if (validate_args(ctx, cnt != NULL) < 0)
473473
return (-1);
474474

475-
if (cnt->flags & OPT_CUDA_COMPAT_MODE_LDCONFIG && cnt->cuda_compat_dir != NULL) {
475+
if ((cnt->flags & OPT_CUDA_COMPAT_MODE_LDCONFIG) && (cnt->cuda_compat_dir != NULL)) {
476476
/*
477477
* We include the cuda_compat_dir directory on the ldconfig
478478
* command line. This ensures that the CUDA Forward compat
479479
* libraries take precendence over the user-mode driver
480480
* libraries in the standard library paths (libs_dir and
481481
* libs32_dir).
482482
* */
483+
log_info("prefering CUDA Forward Compatibility dir when running ldconfig");
483484
argv = (char * []){cnt->cfg.ldconfig, "-f", "/etc/ld.so.conf", "-C", "/etc/ld.so.cache", cnt->cuda_compat_dir, cnt->cfg.libs_dir, cnt->cfg.libs32_dir, NULL};
484485
} else {
485486
argv = (char * []){cnt->cfg.ldconfig, "-f", "/etc/ld.so.conf", "-C", "/etc/ld.so.cache", cnt->cfg.libs_dir, cnt->cfg.libs32_dir, NULL};

0 commit comments

Comments
 (0)