def install_cuda102()

in tools/ami-creator/scripts/win2019_cuda11_installer.py [0:0]


def install_cuda102():
    if os.path.exists("C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\bin"):
        logging.info("CUDA 10.2 already installed, skipping.")
        return False
    logging.info("Downloading CUDA 10.2...")
    cuda_file_path = download(
        'http://developer.download.nvidia.com/compute/cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe')
    try:
        check_call("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(cuda_file_path,
                                                                            cuda_file_path.split('\\')[-1]), shell=True)
    except subprocess.CalledProcessError as e:
        logging.exception("Rename file failed")
    cuda_file_path = cuda_file_path + '.exe'
    logging.info("Installing CUDA 10.2...")
    check_call(cuda_file_path + ' -s')
    #check_call(cuda_file_path + ' -s ' + " ".join([p + "_10.2" for p in CUDA_COMPONENTS]))
    logging.info("Downloading CUDA 10.2 patch...")
    patch_file_path = download(
        'http://developer.download.nvidia.com/compute/cuda/10.2/Prod/patches/1/cuda_10.2.1_win10.exe')
    try:
        check_call("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(patch_file_path,
                                                                            patch_file_path.split('\\')[-1]), shell=True)
    except subprocess.CalledProcessError as e:
        logging.exception("Rename patch failed")
    patch_file_path = patch_file_path + '.exe'
    logging.info("Installing CUDA patch...")
    check_call(patch_file_path + ' -s ')
    logging.info("Done installing CUDA 10.2 and patches.")
    return True