I am trying to SHH into a GCP VM using Paramiko. I am using the Deep Learning image GCP provides with a GPU attached to the instance. So, right after Parakiko SSH into the VM, it asks to install NVIDIA drivers, and we have to press 'y' programmatically. Any idea how? Here's my SSH function:
from paramiko import SSHClient, AutoAddPolicy
ssh_client = SSHClient()
ssh_client.set_missing_host_key_policy(AutoAddPolicy())
retries = 0
while ssh_client:
ssh_client.connect(ip=ip, username=username, port=port,
pkey=paramiko.RSAKey.from_private_key_file(SSH_PRIVATE_KEY_PATH), timeout=10)
retries+=1
break
time.sleep(5)
This is the exact prompt right after SSHing into the instance:
This VM requires Nvidia drivers to function correctly. Installation takes ~1 minute.
Would you like to install the Nvidia driver? [y/n]
Thanks in advance!