def check_driver_installed()

in linux/install_gpu_driver.py [0:0]


def check_driver_installed() -> bool:
    """
    Checks if the driver is already installed by calling the `nvidia-smi` binary.
    If it's available, that means the driver is already installed.
    """
    process = run("which nvidia-smi", check=False)
    if process.returncode != 0:
        return False
    process2 = run("nvidia-smi", check=False)
    return process2.returncode == 0