Skip to content

Commit 5b1e132

Browse files
committed
Merge branch 'upstream-add-fabricmanager-as-ipc' into 'master'
Add fabricmanager as a valid IPC to inject into a container See merge request nvidia/container-toolkit/libnvidia-container!60
2 parents 7100026 + f0ff8ad commit 5b1e132

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/nvc_info.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static const char * const utility_bins[] = {
6060
"nvidia-smi", /* System management interface */
6161
"nvidia-debugdump", /* GPU coredump utility */
6262
"nvidia-persistenced", /* Persistence mode utility */
63+
"nv-fabricmanager", /* NVSwitch fabrimanager utility */
6364
//"nvidia-modprobe", /* Kernel module loader */
6465
//"nvidia-settings", /* X server settings */
6566
//"nvidia-xconfig", /* X xorg.conf editor */
@@ -444,7 +445,7 @@ lookup_ipcs(struct error *err, struct nvc_driver_info *info, const char *root, i
444445
char **ptr;
445446
const char *mps;
446447

447-
info->nipcs = 2;
448+
info->nipcs = 3;
448449
info->ipcs = ptr = array_new(err, info->nipcs);
449450
if (info->ipcs == NULL)
450451
return (-1);
@@ -453,6 +454,10 @@ lookup_ipcs(struct error *err, struct nvc_driver_info *info, const char *root, i
453454
if (find_ipc_path(err, root, NV_PERSISTENCED_SOCKET, ptr++) < 0)
454455
return (-1);
455456
}
457+
if (!(flags & OPT_NO_FABRICMANAGER)) {
458+
if (find_ipc_path(err, root, NV_FABRICMANAGER_SOCKET, ptr++) < 0)
459+
return (-1);
460+
}
456461
if (!(flags & OPT_NO_MPS)) {
457462
if ((mps = secure_getenv("CUDA_MPS_PIPE_DIRECTORY")) == NULL)
458463
mps = NV_MPS_PIPE_DIR;

src/nvc_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define NV_CAPS_DEVICE_DIR _PATH_DEV "nvidia-caps"
3535
#define NV_CAPS_DEVICE_PATH NV_CAPS_DEVICE_DIR "/nvidia-cap%d"
3636
#define NV_PERSISTENCED_SOCKET _PATH_VARRUN "nvidia-persistenced/socket"
37+
#define NV_FABRICMANAGER_SOCKET _PATH_VARRUN "nvidia-fabricmanager/socket"
3738
#define NV_MPS_PIPE_DIR _PATH_TMP "nvidia-mps"
3839
#define NV_PROC_DRIVER "/proc/driver/nvidia"
3940
#define NV_CAPS_PROC_DRIVER "/proc/driver/nvidia-caps"

src/nvc_mount.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const
780780

781781
/* IPC mounts */
782782
for (size_t i = 0; i < info->nipcs; ++i) {
783-
/* XXX Only utility libraries require persistenced IPC, everything else is compute only. */
784-
if (str_has_suffix(NV_PERSISTENCED_SOCKET, info->ipcs[i])) {
783+
/* XXX Only utility libraries require persistenced or fabricmanager IPC, everything else is compute only. */
784+
if (str_has_suffix(NV_PERSISTENCED_SOCKET, info->ipcs[i]) || str_has_suffix(NV_FABRICMANAGER_SOCKET, info->ipcs[i])) {
785785
if (!(cnt->flags & OPT_UTILITY_LIBS))
786786
continue;
787787
} else if (!(cnt->flags & OPT_COMPUTE_LIBS))

src/options.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ static const char * const default_library_opts = "";
2727

2828
/* Driver options */
2929
enum {
30-
OPT_NO_GLVND = 1 << 0,
31-
OPT_NO_UVM = 1 << 1,
32-
OPT_NO_MODESET = 1 << 2,
33-
OPT_NO_MPS = 1 << 3,
34-
OPT_NO_PERSISTENCED = 1 << 4,
30+
OPT_NO_GLVND = 1 << 0,
31+
OPT_NO_UVM = 1 << 1,
32+
OPT_NO_MODESET = 1 << 2,
33+
OPT_NO_MPS = 1 << 3,
34+
OPT_NO_PERSISTENCED = 1 << 4,
35+
OPT_NO_FABRICMANAGER = 1 << 5,
3536
};
3637

3738
static const struct option driver_opts[] = {
@@ -40,6 +41,7 @@ static const struct option driver_opts[] = {
4041
{"no-modeset", OPT_NO_MODESET},
4142
{"no-mps", OPT_NO_MPS},
4243
{"no-persistenced", OPT_NO_PERSISTENCED},
44+
{"no-fabricmanager", OPT_NO_FABRICMANAGER},
4345
};
4446

4547
static const char * const default_driver_opts = "";

0 commit comments

Comments
 (0)