def configure_persistanced_service()

in linux/cuda_installer/os_installers/__init__.py [0:0]


    def configure_persistanced_service(self):
        """
        Configures the nvidia-persistenced daemon to auto-start. It creates a service to be controlled using
        `systemctl`.
        """
        if not pathlib.Path("/usr/bin/nvidia-persistenced").exists():
            return

        if not pathlib.Path(NVIDIA_PERSISTANCED_INSTALLER).exists():
            return

        with tempfile.TemporaryDirectory() as temp_dir:
            shutil.copy(NVIDIA_PERSISTANCED_INSTALLER, temp_dir + "/installer.tar.bz2")
            with chdir(temp_dir):
                self.run("tar -xf installer.tar.bz2", silent=True)
                logger.info("Executing nvidia-persistenced installer...")
                self.run(
                    "sh nvidia-persistenced-init/install.sh",
                    check=self.check_gpu_present(),
                )