moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
7.89k stars 1.09k forks source link

Not able to choose nvidia runtime using --oci-worker-binary #2789

Open ricknitsche opened 2 years ago

ricknitsche commented 2 years ago

Neither --oci-worker-binary nor the binary option in buildkit.tomls [worker.oci] lets me change the runtime to the nvidia one. As value for both, I tried /usr/bin/nvidia-container-runtime, nvidia-container-runtime and nvidia. But the build errors with

buildkitd: failed to find /usr/bin/nvidia-container-runtime binary

But:

$ ls -l /usr/bin/nvidia-container-runtime
-rwxr-xr-x 1 root root 1926824 Mar  6  2018 /usr/bin/nvidia-container-runtime
$ cat /etc/docker/daemon.json
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "default-runtime": "nvidia",
}
tonistiigi commented 2 years ago

What's the way you are running buildkitd? Is it possible that you are running it in a container but your runtime binary is outside of it?

The docker side is expected atm. There isn't a way atm to configure buildkit runtime there other than renaming the binary.

ricknitsche commented 2 years ago

It's through a self-hosted github runner actually. But not in a container.

Which binary do I have to rename?