(self)
Add devices to container
Add devices to container
Add devices to container
def _add_devices(self):
        """Add devices to container"""
        added_devices = []
        for dev in self.opt["devices"]:
            dev_name = dev.split(':')[0]
            if self._add_device_spec(dev_name):
                added_devices.append(dev_name)
        if "/dev/nvidiactl" not in added_devices:
            nvidia_mode = NvidiaMode(self.localrepo, self.container_id)
            if nvidia_mode.get_mode():
                for dev_name in nvidia_mode.get_devices():
                    if dev_name not in added_devices:
                        self._add_device_spec(dev_name)
def _add_devices ( self ) : added_devices = [ ] for dev in self . opt [ "devices" ] : dev_name = dev . split ( ':' ) [ 0 ] if self . _add_device_spec ( dev_name ) : added_devices . append ( dev_name ) if "/dev/nvidiactl" not in added_devices : nvidia_mode = NvidiaMode ( self . localrepo , self . container_id ) if nvidia_mode . get_mode ( ) : for dev_name in nvidia_mode . get_devices ( ) : if dev_name not in added_devices : self . _add_device_spec ( dev_name )