Custom AMI with nvidia driver via packer.

0

Hello,

I have a curious problem that I can seem to make heads or tails of. I am using packer to create a custom AMI that includes the nvidia driver. I am using the base ubuntu 16.04 image on a g4dn.xlarge instance as the packer base and packer completes successfully. It installs the nvidia driver using the NVIDIA-Linux-x86_64-440.33.01.run package. Everything looks good, but when I provision a new ec2 instance from this ami, the nvidia driver is not loaded and I get "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running." when running nvidia-smi. I have tried adding extra steps to the packer project that follow the steps outlined here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html#public-nvidia-driver, but the result is always the same. What I am missing here?

Thanks
Jeremy

demandé il y a 4 ans869 vues
1 réponse
0

I figured out the issue, I need to set the ephemeral storage devices that come with a g4dn in packer to no device:

  "launch_block_device_mappings": \[  
    {  
      "device_name": "/dev/sda1",  
      "delete_on_termination": true,  
      "volume_size": "125",  
      "volume_type": "gp2"  
    },  
    {  
      "device_name": "/dev/sdb",  
      "no_device": true  
    },  
    {  
      "device_name": "/dev/sdc",  
      "no_device": true  
    }  
  ]
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions