Skip to content

[ci] Configure docker for Vulkan on NVIDIA and use it in Kokoro - #2484

Merged
antiagainst merged 10 commits into
iree-org:mainfrom
antiagainst:cloud-gpu
Jul 17, 2020
Merged

antiagainst merged 10 commits into
iree-org:mainfrom
antiagainst:cloud-gpu

Conversation

@antiagainst

Copy link
Copy Markdown
Member

This commit adds a Dockerfile for packing the NVIDIA driver and
Vulkan SDK inside a docker image and redirects the CMake tests
to use this docker image to enable testing Vulkan HAL backend.

This commit adds a Dockerfile for packing the NVIDIA driver and
Vulkan SDK inside a docker image and redirects the CMake tests
to use this docker image to enable testing Vulkan HAL backend.
@antiagainst

Copy link
Copy Markdown
Member Author

Note that this is expected to fail given that we need to install the Vulkan driver and SDK on the GCP instance behind Kokoro, push the docker image to iree-oss. After that, there is still a failing Vulkan test that need to be fixed.

@phoenix-meadowlark

Copy link
Copy Markdown
Contributor
[02:16:41 UTC] docker run --volume /tmpfs/src/github/iree:/tmpfs/src/github/iree --workdir=/tmpfs/src/github/iree --rm --gpus all gcr.io/iree-oss/cmake-nvidia:prod kokoro/gcp_ubuntu/cmake/build.sh
unknown flag: --gpus
See 'docker run --help'.

It looks like Kokoro's Docker version is probably < 19.3. Could you try logging the version and updating it? Hopefully the update doesn't take too much time, because from what @GMNGeoffrey has said, we probably don't want to update the Kokoro VM image to have it.

@GMNGeoffrey

Copy link
Copy Markdown
Member

It looks like Kokoro's Docker version is probably < 19.3. Could you try logging the version and updating it? Hopefully the update doesn't take too much time, because from what @GMNGeoffrey has said, we probably don't want to update the Kokoro VM image to have it.

Updating the Kokoro VM image is a PITA, but may be necessary here :-/

@antiagainst

Copy link
Copy Markdown
Member Author

Yeah from what I can tell using Docker >= 19.03 is required: https://github.com/NVIDIA/nvidia-docker#quickstart. The world around GPUs can be quite fragile so I'd suggest we go with the version bump instead of trying to figure out ways to solve it by ourselves. ;-P

I'm a bit confused here: I thought Kokoro is just a coordinator for distributing jobs to those workers in GCP and the real Docker containers are run by GCP instances? I've tried setting up some toy GCP instances and install the newest Docker following https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04. It works there. I'd assume we can also use the same package source there and update to the newest version? But I might miss something here.

@antiagainst

Copy link
Copy Markdown
Member Author

Blocked by #2500.

@GMNGeoffrey

Copy link
Copy Markdown
Member

Yeah from what I can tell using Docker >= 19.03 is required: NVIDIA/nvidia-docker#quickstart. The world around GPUs can be quite fragile so I'd suggest we go with the version bump instead of trying to figure out ways to solve it by ourselves. ;-P

I'm a bit confused here: I thought Kokoro is just a coordinator for distributing jobs to those workers in GCP and the real Docker containers are run by GCP instances? I've tried setting up some toy GCP instances and install the newest Docker following digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04. It works there. I'd assume we can also use the same package source there and update to the newest version? But I might miss something here.

Yeah the issue is that Kokoro has some provided VM images that have the software necessary for Kokoro. In the past we had to use custom images forking from those that added any new required software. Updating those is a PITA. They're not well maintained at all and are basically an image frozen with the software at the point that the team gave up on trying to provide an image that had everything that everyone needed. Past attempts to update them have sometimes resulted in mysterious errors. Like when we tried to upgrade the Python version and that somehow resulted in the build directory getting deleted halfway through the build (#1346). With the move to docker, we have all the dependencies we need installed in the container instead which means we're back on the standard Kokoro images. It looks like this will actually require an image change. Not the end of the world. Just kind of unfortunate. I'll have to restore the documentation page on how to update these images

@antiagainst

Copy link
Copy Markdown
Member Author

Oh I see. Thanks for the explanation! Gah, that is painful.

Comment thread kokoro/gcp_ubuntu/cmake/build_kokoro.sh Resolved
@antiagainst
antiagainst requested a review from GMNGeoffrey July 16, 2020 14:13
@GMNGeoffrey

Copy link
Copy Markdown
Member

Note I added a couple commits here 55bccf5 makes these scripts use the latest tag so we can test them out without pushing something with the prod tag. It should be dropped before submitting. I also updated the Python script that builds and pushes the docker images to include this one because I had to do that anyway to push a new image for testing

@GMNGeoffrey

Copy link
Copy Markdown
Member

@GMNGeoffrey GMNGeoffrey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please switch the docker tag back to "prod" when testing is complete.

Comment thread build_tools/cmake/test.sh Resolved
ARG VULKAN_SDK_VERSION=1.2.141

# Disable apt-key parse waring.
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually necessary? I think that's only required if you're parsing the apt-key output, which we're not here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah otherwise I see "Warning: apt-key output should not be parsed (stdout is not a terminal)" due to adding key from lunarg.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird... when I run the command locally I don't see that error, but I do when building the docker container. I guess despite what the warning says, what it's actually complaining about is usage within a script? I'm worried that the warning is there for a reason:

From the apt-key docs:

the programmatic usage (especially in package maintainer scripts!) is strongly discouraged.

It would be nice to figure out how to avoid this. Maybe it's better to to not use apt, for instance?

Anyway, let's not block on this.

@GMNGeoffrey

Copy link
Copy Markdown
Member

Test invocation is at source.cloud.google.com/results/invocations/2bae146f-c58f-4f51-9b53-c86a1743a4ac/targets (still running right now).

All the actual builds passed and then this...

[01:14:00 UTC] sudo rm -rf /tmpfs/src/github
sudo: no tty present and no askpass program specified

Probably another issue with the image. sigh If you want to remove the rm -rf line for now, that's fine. It just makes the build faster by preventing Kokoro from doing stupid stuff. I can iterate on getting it working.

@antiagainst
antiagainst requested a review from GMNGeoffrey July 17, 2020 12:19
@antiagainst

Copy link
Copy Markdown
Member Author

Done. I think we just need to tag a docker image as prod now?

ARG VULKAN_SDK_VERSION=1.2.141

# Disable apt-key parse waring.
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird... when I run the command locally I don't see that error, but I do when building the docker container. I guess despite what the warning says, what it's actually complaining about is usage within a script? I'm worried that the warning is there for a reason:

From the apt-key docs:

the programmatic usage (especially in package maintainer scripts!) is strongly discouraged.

It would be nice to figure out how to avoid this. Maybe it's better to to not use apt, for instance?

Anyway, let's not block on this.

@antiagainst
antiagainst merged commit 69a0100 into iree-org:main Jul 17, 2020
@antiagainst
antiagainst deleted the cloud-gpu branch July 17, 2020 19:05
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1

# Disable prompt during keyboard configuration.
ENV DEBIAN_FRONTEND=noninteractive

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this might be what's causing the sudo problems? I just tried without it and seems to work fine?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems.. quite weird this can cause sudo issues. I was having problems when building the docker image without this. But maybe something gotten changed along the way so this is not needed anymore. Feel free to remove it if that's the case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe move this to prefix the following RUN command so it's scoped?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants