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

gefragt vor 4 Jahren869 Aufrufe
1 Antwort
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  
    }  
  ]
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen