def check_linux_distro()

in linux/install_gpu_driver.py [0:0]


def check_linux_distro(system: System, version: str) -> bool:
    """
    Checks if given system version is supported by this script.
    Returns False if not, and prints information about the incompatibility.
    """
    if "." in version:
        version = version.split(".")[0]

    if len(SUPPORTED_SYSTEMS[system]) == 0:
        print_out(f"The {system} distribution is not supported by this script.")
        print_out(
            "You may check https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html"
        )
        print_out("to try installing the drivers manually.")
        return False
    elif version not in SUPPORTED_SYSTEMS[system]:
        print_out(f"The version {version} of {system} is not supported by this script.")
        print_out(f"Supported versions: {SUPPORTED_SYSTEMS[system]}")
        print_out(
            "You may try installing the driver manually following instructions from: "
        )
        print_out(
            "https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html"
        )
        return False

    return True