Skip to content

Nvidia driver/library mismatch on real GPU (turing) builds #4507

Closed

Description

@GMNGeoffrey

We've been seeing some extremely mysterious intermittent failures on the cmake turing build

docker run --volume=/tmpfs/src/github/iree:/tmpfs/src/github/iree --workdir=/tmpfs/src/github/iree --rm --user=1003:1004 --volume=/tmpfs/fake_etc/group:/etc/group:ro --volume=/tmpfs/fake_etc/passwd:/etc/passwd:ro --volume=/tmpfs/fake_home:/home/kbuilder --volume=/home/kbuilder/.config/gcloud:/home/kbuilder/.config/gcloud:ro --gpus all gcr.io/iree-oss/cmake-python-nvidia@sha256:b77508153d66d55cd89be80d54484972340ea9c49dbb1285403386215afdcdf7 build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused "process_linux.go:432: running prestart hook 0 caused "error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver/library version mismatch\n""": unknown.

e.g. https://source.cloud.google.com/results/invocations/5653316c-e237-42f6-9959-ae292896059b/targets/iree%2Fgcp_ubuntu%2Fcmake%2Flinux%2Fx86-turing%2Fmain/log

These point to a mismatch between the Nvidia driver on the docker image and the underlying vm image (which have to be the same for docker to work with GPUs).

Tangential rant:
But we haven't updated the VM image since we got it working in July (2020-07-24, to be precise) and we haven't updated anything about any relevant directory in two weeks (let alone actually substantive changes that could affect this, which hasn't changed in months). So we're deeply confused what's going on here. Ubuntu seems to have dropped support for the 440 nvidia driver we're using, but I don't understand how that could've been incorporated into our static VM image.

Anyway, while mystified why this is occurring, we suspect that just updating both the VM image and the docker image to use the latest (and the same) Nvidia drivers should make this issue go away. Since there's no way to update these at the same time and since it's already failing, I'm going to disable the real GPU continuous builds temporarily to reduce noise while this goes through.

Activity

  1. added
    bug 🐞
    infrastructure
    on Jan 13, 2021
  2. GMNGeoffrey commented on Jan 13, 2021

    @GMNGeoffrey
    MemberAuthor

    I believe we may have figured out why this is happening

    $ pgrep -i apt --list-full
    5077 /bin/sh /usr/lib/apt/apt.systemd.daily install
    5093 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
    

    Ubuntu is upgrading itself with some cron job. That probably also explains why it was intermittent. Only in VMs where this had completed would we get the failure. Ugh that is so annoying :-P These updates are possible to disable: https://linuxconfig.org/disable-automatic-updates-on-ubuntu-18-04-bionic-beaver-linux

    Of course there are dire warnings there about security... Hmmmm

    I think we can just freeze the Nvidia drivers:

    https://chrisalbon.com/deep_learning/setup/prevent_nvidia_drivers_from_upgrading/

    That seems like a reasonable compromise

  3. GMNGeoffrey commented on Jan 13, 2021

    @GMNGeoffrey
    MemberAuthor

    Even better:

    When the apt job starts, it will sleep for a random period between 0 and APT::Periodic::RandomSleep seconds. The default value is "1800" so that the script will stall for up to 30 minutes (1800 seconds) so that the mirror servers are not crushed by everyone running their updates all at the same time. Only set this to 0 if you use a local mirror and don't mind the load spikes. Note that while the apt job is sleeping it will cause the execution of the rest of your cron.daily jobs to be delayed.

  4. GMNGeoffrey commented on Jan 13, 2021

    @GMNGeoffrey
    MemberAuthor

    I'm turning off auto-upgrades. These are short-lived VMs anyway, so we wouldn't even get any real benefit

  5. GMNGeoffrey commented on Jan 14, 2021

    @GMNGeoffrey
    MemberAuthor

    And figured out why this wasn't happening in the cmake-bazel turing build. That build is not actually using real GPUs at all 🤦 (#4514)

  6. antiagainst commented on Jan 14, 2021

    @antiagainst
    Member

    Great findings! Thanks @GMNGeoffrey for digging these weirdness out!! :D

    I suspect that we used a graphical Ubuntu desktop as the base for the VM image? Auto updating seems something suitable there. I won't expect a server Ubuntu to do that. Ubuntu official docker images do not have /etc/apt/apt.conf.d/20auto-upgrades either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug 🐞infrastructure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions