Skip to content

Docker can't find build.toml #158

@kamakuta

Description

@kamakuta

I'm trying to run docker run --mount type=bind,source=$(pwd),target=/kernelcode ghcr.io/huggingface/kernel-builder:{SHA} from the README's Quick Start, but it crashes with Error: Cannot open build.toml for reading.

Steps to reproduce:

git clone https://github.com/huggingface/kernel-builder
cd kernel-builder/examples/activation/
docker run --mount type=bind,source=$(pwd),target=/kernelcode ghcr.io/huggingface/kernel-builder:latest

I get

Building Torch Extension Bundle
Building with rev vgy6yxyszg
No flake.nix found, creating a basic one...
flake.nix created. You can customize it as needed.
this derivation will be built:
  /nix/store/gccmdrfhspids0gybs3191i1n16q33cj-update-build.drv
these 37 paths will be fetched (18.18 MiB download, 84.78 MiB unpacked):
  /nix/store/z8fzi165wkivbikld909bl5zk6r29vsx-acl-2.3.2
  /nix/store/49dxdr3ln7xfna1b94vi5hra6rgqk6h1-attr-2.5.2
  /nix/store/xg75pc4yyfd5n2fimhb98ps910q5lm5n-bash-5.2p37
  /nix/store/dknmf3dcqcag8g2wy0f5a6bhscqwi3r5-build2cmake-0.2.1
  /nix/store/mq1680dppidpggmaqaklwapvgm6iw3a6-bzip2-1.0.8
  /nix/store/sysih19x8xx8l473d3qnr760hy758lkq-bzip2-1.0.8-bin
  /nix/store/cg09nslw3w6afyynjw484b86d47ic1cb-coreutils-9.7
  /nix/store/8cs5vjkbwf2vicgms4km5k1kgbznhwip-diffutils-3.12
  /nix/store/f2dlmh055sqy5xqk0qrswfvpddxgy9hz-ed-1.21.1
  /nix/store/hb9v0qx9vk0420z5grlnv2y5wcf6dp6i-file-5.46
  /nix/store/frspb25x6v43fwv6b0wna1fm5nsqcp0b-findutils-4.10.0
  /nix/store/f8x04xqd2cs274k0hgfzsrms6sby2fgx-gawk-5.3.2
  /nix/store/gv7z0km39q3fgzavpic8vrl7smh5n2w6-gcc-14.2.1.20250322-lib
  /nix/store/0x600292yi5qzg389nan9j4dvzlh8785-gcc-14.2.1.20250322-libgcc
  /nix/store/g3s0z9r7m1lsfxdk8bj88nw8k8q3dmmg-glibc-2.40-66
  /nix/store/g0i57kz7yrssdv4iw2bj8202xxpl8dbq-gmp-with-cxx-6.3.0
  /nix/store/dhiwbm7kzlc01yk99900g8lj2g7faxyn-gnu-config-2024-01-01
  /nix/store/2wni3gbcf6fqwlfb2h9sv7jvqlpf1ylq-gnugrep-3.11
  /nix/store/agn71jakv0a9669k3zx5g9aqm2sl9z77-gnumake-4.4.1
  /nix/store/1h8gf327cgid0jgjygrj31amp63mn7a7-gnused-4.9
  /nix/store/5jmcn57x2j9mkdr3j947cbja2hpxmhfn-gnutar-1.35
  /nix/store/04z4rhjadrnd0w3ib2sl42pa3xjgpf7p-gzip-1.14
  /nix/store/cjs7mgw6q8zp75qapfmqhqnbf62b3fwa-libgit2-1.9.0-lib
  /nix/store/y0ii7yfaxi2k2vnfyknb64rcczsdyjkf-libidn2-2.3.8
  /nix/store/1i5cz1bqy7g9kaq6dkaqchn857b2h8cs-libssh2-1.11.1
  /nix/store/vzdd455zm255kx85hg1cvci3bbn8adwj-libunistring-1.3
  /nix/store/8ms1zkkidmvnghnvdx07yjzj8cvi4dzm-llhttp-9.2.1
  /nix/store/xy8x4g472i5n1bh24c5ixhbnk6qlm9vz-openssl-3.4.1
  /nix/store/qd20g193gch8bj4h0h44wr97mw0bhkmf-patch-2.7.6
  /nix/store/5yl5rscbbqh9b3r9ixi6cnzfaydq9n9r-patchelf-0.15.0
  /nix/store/chg330wi4p9g0r9bab2186wwhbgmlm5z-pcre2-10.44
  /nix/store/lgydi1gl5wqcw6k4gyjbaxx7b40zxrsp-stdenv-linux
  /nix/store/d41c6ccm4yaq2czglxs10lzkynrmd399-update-autotools-gnu-config-scripts-hook
  /nix/store/fdsndp18qa1fk375vcd4vrn00c0p4zpr-xgcc-14.2.1.20250322-libgcc
  /nix/store/hzfjla4v6x1851jh0wakajlqif0jxrgy-xz-5.8.1
  /nix/store/fi495i6cz40rq1axig930jzyw7ln0zhm-xz-5.8.1-bin
  /nix/store/8dr41ckl7sbv2v5aim3csxzql03z68hk-zlib-1.3.1
copying path '/nix/store/0x600292yi5qzg389nan9j4dvzlh8785-gcc-14.2.1.20250322-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/dhiwbm7kzlc01yk99900g8lj2g7faxyn-gnu-config-2024-01-01' from 'https://cache.nixos.org'...
copying path '/nix/store/fdsndp18qa1fk375vcd4vrn00c0p4zpr-xgcc-14.2.1.20250322-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/vzdd455zm255kx85hg1cvci3bbn8adwj-libunistring-1.3' from 'https://cache.nixos.org'...
copying path '/nix/store/d41c6ccm4yaq2czglxs10lzkynrmd399-update-autotools-gnu-config-scripts-hook' from 'https://cache.nixos.org'...
copying path '/nix/store/y0ii7yfaxi2k2vnfyknb64rcczsdyjkf-libidn2-2.3.8' from 'https://cache.nixos.org'...
copying path '/nix/store/g3s0z9r7m1lsfxdk8bj88nw8k8q3dmmg-glibc-2.40-66' from 'https://cache.nixos.org'...
copying path '/nix/store/49dxdr3ln7xfna1b94vi5hra6rgqk6h1-attr-2.5.2' from 'https://cache.nixos.org'...
copying path '/nix/store/xg75pc4yyfd5n2fimhb98ps910q5lm5n-bash-5.2p37' from 'https://cache.nixos.org'...
copying path '/nix/store/mq1680dppidpggmaqaklwapvgm6iw3a6-bzip2-1.0.8' from 'https://cache.nixos.org'...
copying path '/nix/store/f2dlmh055sqy5xqk0qrswfvpddxgy9hz-ed-1.21.1' from 'https://cache.nixos.org'...
copying path '/nix/store/f8x04xqd2cs274k0hgfzsrms6sby2fgx-gawk-5.3.2' from 'https://cache.nixos.org'...
copying path '/nix/store/gv7z0km39q3fgzavpic8vrl7smh5n2w6-gcc-14.2.1.20250322-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/agn71jakv0a9669k3zx5g9aqm2sl9z77-gnumake-4.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/1h8gf327cgid0jgjygrj31amp63mn7a7-gnused-4.9' from 'https://cache.nixos.org'...
copying path '/nix/store/8ms1zkkidmvnghnvdx07yjzj8cvi4dzm-llhttp-9.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/xy8x4g472i5n1bh24c5ixhbnk6qlm9vz-openssl-3.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/chg330wi4p9g0r9bab2186wwhbgmlm5z-pcre2-10.44' from 'https://cache.nixos.org'...
copying path '/nix/store/hzfjla4v6x1851jh0wakajlqif0jxrgy-xz-5.8.1' from 'https://cache.nixos.org'...
copying path '/nix/store/8dr41ckl7sbv2v5aim3csxzql03z68hk-zlib-1.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/z8fzi165wkivbikld909bl5zk6r29vsx-acl-2.3.2' from 'https://cache.nixos.org'...
copying path '/nix/store/sysih19x8xx8l473d3qnr760hy758lkq-bzip2-1.0.8-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/hb9v0qx9vk0420z5grlnv2y5wcf6dp6i-file-5.46' from 'https://cache.nixos.org'...
copying path '/nix/store/qd20g193gch8bj4h0h44wr97mw0bhkmf-patch-2.7.6' from 'https://cache.nixos.org'...
copying path '/nix/store/fi495i6cz40rq1axig930jzyw7ln0zhm-xz-5.8.1-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/2wni3gbcf6fqwlfb2h9sv7jvqlpf1ylq-gnugrep-3.11' from 'https://cache.nixos.org'...
copying path '/nix/store/5jmcn57x2j9mkdr3j947cbja2hpxmhfn-gnutar-1.35' from 'https://cache.nixos.org'...
copying path '/nix/store/04z4rhjadrnd0w3ib2sl42pa3xjgpf7p-gzip-1.14' from 'https://cache.nixos.org'...
copying path '/nix/store/1i5cz1bqy7g9kaq6dkaqchn857b2h8cs-libssh2-1.11.1' from 'https://cache.nixos.org'...
copying path '/nix/store/g0i57kz7yrssdv4iw2bj8202xxpl8dbq-gmp-with-cxx-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/5yl5rscbbqh9b3r9ixi6cnzfaydq9n9r-patchelf-0.15.0' from 'https://cache.nixos.org'...
copying path '/nix/store/cjs7mgw6q8zp75qapfmqhqnbf62b3fwa-libgit2-1.9.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/cg09nslw3w6afyynjw484b86d47ic1cb-coreutils-9.7' from 'https://cache.nixos.org'...
copying path '/nix/store/dknmf3dcqcag8g2wy0f5a6bhscqwi3r5-build2cmake-0.2.1' from 'https://huggingface.cachix.org'...
copying path '/nix/store/8cs5vjkbwf2vicgms4km5k1kgbznhwip-diffutils-3.12' from 'https://cache.nixos.org'...
copying path '/nix/store/frspb25x6v43fwv6b0wna1fm5nsqcp0b-findutils-4.10.0' from 'https://cache.nixos.org'...
copying path '/nix/store/lgydi1gl5wqcw6k4gyjbaxx7b40zxrsp-stdenv-linux' from 'https://cache.nixos.org'...
building '/nix/store/gccmdrfhspids0gybs3191i1n16q33cj-update-build.drv'...
Error: Cannot open build.toml for reading

Caused by:
    No such file or directory (os error 2)

Location:
    src/main.rs:241:10

If I run docker interactively, I can read it

docker run -it --mount type=bind,source=$(pwd),target=/kernelcode --entrypoint /bin/sh ghcr.io/huggingface/kernel-builder:latest
sh-5.2$ cat /kernelcode/build.toml
[general]
name = "activation"
universal = false

[torch]
src = [
    "torch-ext/torch_binding.cpp",
    "torch-ext/torch_binding.h",
]

[kernel.activation]
backend = "cuda"
depends = ["torch"]
src = [
    "activation/activation_kernels.cu",
    "activation/cuda_compat.h",
    "activation/dispatch_utils.h",
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions