23 #include <RdkPluginBase.h>
25 #include <sys/types.h>
26 #include <netinet/in.h>
47 GpuPlugin(std::shared_ptr<rt_dobby_schema> &containerConfig,
48 const std::shared_ptr<DobbyRdkPluginUtils> &utils,
49 const std::string &rootfsPath);
52 inline std::string
name()
const override
73 bool bindMountGpuCgroup(
const std::string &source,
74 const std::string &target);
77 const std::string mName;
78 std::shared_ptr<rt_dobby_schema> mContainerConfig;
79 const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
Dobby GPU plugin.
Definition: GpuPlugin.h:45
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: GpuPlugin.cpp:146
bool postStop() override
We use the postStop point to remove the cgroup directory created in the createRuntime phase.
Definition: GpuPlugin.cpp:105
std::string getGpuCgroupMountPoint()
Attempts to get the mount point of the gpu cgroup filesystem.
Definition: GpuPlugin.cpp:172
bool setupContainerGpuLimit(const std::string cgroupDirPath, pid_t containerPid, int memoryLimit)
Creates a gpu cgroup for the container and moves the container into it.
Definition: GpuPlugin.cpp:240
bool createRuntime() override
we use the createRuntime point to create a cgroup and put the containered process into it.
Definition: GpuPlugin.cpp:63
std::string name() const override
Should return the name of the plugin.
Definition: GpuPlugin.h:52
unsigned hookHints() const override
Should return a bitfield of the hook points implemented by the plugin.
Definition: GpuPlugin.cpp:43
Basic object that provides the default overrides for a plugin.
Definition: RdkPluginBase.h:34