Network issues related to nvidia.runtime

I used the following profile to create a container called nc
, but there are some network related issues.

  1. The container cannot connect to Internet. If I use default profile, the networking works. If I attach a gpu device to container after creating, it works. However, after I set the nvidia.runtime = true and restart container, the Internet will down.
  2. After some debuging, I found the container which nvidia.runtime=true flag, its networking and resolvconf service will not auto start, and eth0 will not get a IPV4 address.
  3. I manually start networking and resolvconf service, and my eth0 can get IPV4 address, but dns seems not working. That is I can ping 8.8.8.8 successfully, but I can not ping google.com
config:
  nvidia.runtime: "true"
description: Nvidia card support
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  gpu0:
    pci: "0000:01:00.0"
    type: gpu
  root:
    path: /
    pool: default
    type: disk
name: ncard
used_by:
- /1.0/containers/nc

I tried another container version of ubuntu (xenial), and the network issues did not appear.
I think you can reproduce this bug in ubuntu trusty container.
p.s. host machine ubuntu version: 4.18.0-25-generic #26~18.04.1-Ubuntu