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

질문됨 4년 전869회 조회
1개 답변
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  
    }  
  ]
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠