mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From klue...@apache.org
Subject mesos git commit: Added ability to dynamically load '/dev/nvidia-uvm' in GPU isolator.
Date Mon, 13 Mar 2017 00:40:18 GMT
Repository: mesos
Updated Branches:
  refs/heads/1.2.x a7e647017 -> 801cdfac6


Added ability to dynamically load '/dev/nvidia-uvm' in GPU isolator.

Review: https://reviews.apache.org/r/57539/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/801cdfac
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/801cdfac
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/801cdfac

Branch: refs/heads/1.2.x
Commit: 801cdfac64fba8eaa09ec715e5631999c5c4f98e
Parents: a7e6470
Author: Kevin Klues <klueska@gmail.com>
Authored: Sun Mar 12 17:25:40 2017 -0700
Committer: Kevin Klues <klueska@gmail.com>
Committed: Sun Mar 12 17:34:26 2017 -0700

----------------------------------------------------------------------
 .../containerizer/mesos/isolators/gpu/isolator.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/801cdfac/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
index a3b9fe7..d4ab539 100644
--- a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
@@ -157,6 +157,23 @@ Try<Isolator*> NvidiaGpuIsolatorProcess::create(
 
   deviceEntries[Path("/dev/nvidiactl")] = entry;
 
+  // The `nvidia-uvm` module is not typically loaded by default on
+  // systems that have Nvidia GPU drivers installed. Instead,
+  // applications that require this module use `nvidia-modprobe` to
+  // load it dynamically on first use. This program both loads the
+  // `nvidia-uvm` kernel module and creates the corresponding
+  // `/dev/nvidia-uvm` device that it controls.
+  //
+  // We call `nvidia-modprobe` here to ensure that `/dev/nvidia-uvm`
+  // is properly created so we can inject it into any containers that
+  // may require it.
+  if (!os::exists("/dev/nvidia-uvm")) {
+    Try<string> modprobe = os::shell("nvidia-modprobe -u -c 0");
+    if (modprobe.isError()) {
+      return Error("Failed to load '/dev/nvidia-uvm': " + modprobe.error());
+    }
+  }
+
   device = os::stat::rdev("/dev/nvidia-uvm");
   if (device.isError()) {
     return Error("Failed to obtain device ID for '/dev/nvidia-uvm': " +


Mime
View raw message