def install()

in linux/install_gpu_driver.py [0:0]


def install(args: argparse.Namespace):
    # Prerequisites
    check_python_version()
    if os.geteuid() != 0:
        print("This script needs to be run with root privileges!")
        sys.exit(1)

    # Set up the log directory.
    Logger.setup_log_dir()

    if check_driver_installed() and not args.force:
        print("Already installed.")
        sys.exit(0)

    # Check what system we're running
    system, version = detect_linux_distro()
    # Install the drivers and CUDA Toolkit
    install_dependencies(system, version)
    if not detect_gpu_device() and not args.force:
        print(
            "There doesn't seem to be a GPU unit connected to your system. "
            "Aborting drivers installation."
        )
        sys.exit(0)
    install_driver_runfile(system, version)
    post_install_steps()