def verify_driver()

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


    def verify_driver(self, verbose: bool = False) -> bool:
        """
        Checks if the driver is already installed by calling the `nvidia-smi` binary.
        If it's available and doesn't produce errors, that means the driver is already installed.
        """
        process = self.run("which nvidia-smi", check=False, silent=True)
        if process.returncode != 0:
            if verbose:
                print("Couldn't find nvidia-smi, the driver is not installed.")
            return False
        process2 = self.run("nvidia-smi -L", check=False, silent=True)
        success = process2.returncode == 0 and "UUID" in process2.stdout
        if verbose:
            print(f"nvidia-smi -L output: {process2.stdout} {process2.stderr}")
        return success