(self, force=False)
return True
Set nvidia mode
Set nvidia mode
Set nvidia mode
def set_mode(self, force=False):
        """Set nvidia mode"""
        if not self.container_dir:
            Msg().err("Error: nvidia set mode container dir not found")
            return False
        nvi_host_dir_list = self._find_host_dir()
        nvi_cont_dir = self._find_cont_dir()
        if not nvi_host_dir_list:
            Msg().err("Error: host nvidia libraries not found")
            return False
        if not nvi_cont_dir:
            Msg().err("Error: destination dir for nvidia libs not found")
            return False
        if (not force) and self._installation_exists(nvi_host_dir_list,
                                                     nvi_cont_dir):
            Msg().err("Error: nvidia installation already exists"
                      ", use --force to overwrite")
            return False
        for nvi_host_dir in nvi_host_dir_list:
            lib_list = self._get_nvidia_libs(nvi_host_dir)
            self._copy_files(nvi_host_dir, nvi_cont_dir, lib_list, force)
        self._copy_files('/etc', '/etc', Config.conf['nvi_etc_list'], force)
        self._copy_files('/usr/bin', '/usr/bin', Config.conf['nvi_bin_list'],
                         force)
        FileUtil(self._container_nvidia_set).putdata("", 'w')
        Msg().out("Info: nvidia mode set")
        return True
def set_mode ( self , force = False ) : if not self . container_dir : Msg ( ) . err ( "Error: nvidia set mode container dir not found" ) return False nvi_host_dir_list = self . _find_host_dir ( ) nvi_cont_dir = self . _find_cont_dir ( ) if not nvi_host_dir_list : Msg ( ) . err ( "Error: host nvidia libraries not found" ) return False if not nvi_cont_dir : Msg ( ) . err ( "Error: destination dir for nvidia libs not found" ) return False if ( not force ) and self . _installation_exists ( nvi_host_dir_list , nvi_cont_dir ) : Msg ( ) . err ( "Error: nvidia installation already exists" ", use --force to overwrite" ) return False for nvi_host_dir in nvi_host_dir_list : lib_list = self . _get_nvidia_libs ( nvi_host_dir ) self . _copy_files ( nvi_host_dir , nvi_cont_dir , lib_list , force ) self . _copy_files ( '/etc' , '/etc' , Config . conf [ 'nvi_etc_list' ] , force ) self . _copy_files ( '/usr/bin' , '/usr/bin' , Config . conf [ 'nvi_bin_list' ] , force ) FileUtil ( self . _container_nvidia_set ) . putdata ( "" , 'w' ) Msg ( ) . out ( "Info: nvidia mode set" ) return True