Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: rocmPackages.llvm.libc #368672

Closed
Mikilio opened this issue Dec 27, 2024 · 30 comments · Fixed by #370180
Closed

Build failure: rocmPackages.llvm.libc #368672

Mikilio opened this issue Dec 27, 2024 · 30 comments · Fixed by #370180
Labels

Comments

@Mikilio
Copy link
Contributor

Mikilio commented Dec 27, 2024

Steps To Reproduce

Steps to reproduce the behavior:

nix build github:NixOS/nixpkgs#rocmPackages.llvm.libc

Build log

log.txt

Short version
error: builder for '/nix/store/axshsp2rv451cn9cqhn0djrcjdkr9l0b-rocm-llvm-libc-6.0.2.drv' failed with exit code 1;
       last 25 log lines:
       > #include <cassert>
       >          ^~~~~~~~~
       > 1 error generated.
       > [4/322] Building CXX object libc/utils/testutils/CMakeFiles/libc_test_utils.dir/Timer.cpp.o
       > FAILED: libc/utils/testutils/CMakeFiles/libc_test_utils.dir/Timer.cpp.o
       > /nix/store/7sqn5142gh5asri8aqxvsvib9ii37fyq-rocm-llvm-clang-unwrapped-wrapper-6.0.2/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -MD -MT libc/utils/testutils/CMakeFiles/libc_test_utils.dir/Timer.cpp.o -MF libc/utils/testutils/CMakeFiles/libc_test_utils.dir/Timer.cpp.o.d -o libc/utils/testutils/CMakeFiles/libc_test_utils.dir/Timer.cpp.o -c /build/source/libc/utils/testutils/Timer.cpp
       > /build/source/libc/utils/testutils/Timer.cpp:11:10: fatal error: 'chrono' file not found
       > #include <chrono>
       >          ^~~~~~~~
       > 1 error generated.
       > [5/322] Building CXX object libc/src/errno/CMakeFiles/libc.src.errno.errno.dir/libc_errno.cpp.o
       > [6/322] Building CXX object libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o
       > FAILED: libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o
       > /nix/store/7sqn5142gh5asri8aqxvsvib9ii37fyq-rocm-llvm-clang-unwrapped-wrapper-6.0.2/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -MD -MT libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o -MF libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o.d -o libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o -c /build/source/libc/utils/testutils/ExecuteFunctionUnix.cpp
       > /build/source/libc/utils/testutils/ExecuteFunctionUnix.cpp:10:10: fatal error: 'cassert' file not found
       > #include <cassert>
       >          ^~~~~~~~~
       > 1 error generated.
       > [7/322] Building CXX object libc/utils/testutils/CMakeFiles/libc_test_utils.dir/RoundingModeUtils.cpp.o
       > /build/source/libc/utils/testutils/RoundingModeUtils.cpp:30:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
       >   default:
       >   ^
       > 1 warning generated.
       > [8/322] Building CXX object libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o
       > ninja: build stopped: subcommand failed.

Additional context

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.66-hardened1, NixOS, 25.05 (Warbler), 25.05.20241219.d70bd19
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • nixpkgs: /nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source

Notify maintainers

@acowley
@lovesegfault


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@Mikilio Mikilio added the 0.kind: build failure A package fails to build label Dec 27, 2024
@Mikilio
Copy link
Contributor Author

Mikilio commented Dec 27, 2024

Can confirm that nix build github:NixOS/nixpkgs/e0464e47880a69896f0fb1810f00e0de469f770a#rocmPackages.llvm.libc builds fine. So the latest commits messed something up and possibly more.

@Hajitorus
Copy link

Hajitorus commented Dec 28, 2024

Build succeeds:

nix build github:NixOS/nixpkgs/585f76290ed66a3fdc5aae0933b73f9fd3dca7e3#rocmPackages.llvm.libc

Build fails:

nix build github:NixOS/nixpkgs/fc9c33366b98237cc759cdd90ef6058f5a1cb9dd#rocmPackages.llvm.libc.

Looks like #361878? Sorry, I'm not sure I have the resources to bisect which of the staging-next commits changed expectations here.

@Mikilio
Copy link
Contributor Author

Mikilio commented Dec 28, 2024

Currently bisecting this.

@Mikilio
Copy link
Contributor Author

Mikilio commented Dec 28, 2024

first bad commit: [a1c1180] libuv: 1.48.0 -> 1.49.2

It seems I took a way too early bad commit. As this error has nothing to do with the current issue.

@Shawn8901
Copy link
Contributor

Shawn8901 commented Dec 28, 2024

fyi: be aware that the merged staging next bumped gcc13 to gcc14. If i saw it correctly when trying to address it at #197885 (comment) the failure was then building the stage1 compiler (which is compiled by gcc).

#367695 does an overall bump and with that the observed error was not existing for me.
So possibly a good invest is to work on those improvements if there is none super into the old version

@GZGavinZhao
Copy link
Contributor

I remember seeing this error when working on #367695 and later being fixed, so #367695 is likely going to close this.

Jozhin-s-Bazhin added a commit to Jozhin-s-Bazhin/nixos-config that referenced this issue Dec 29, 2024
Arsalan2356 added a commit to Arsalan2356/dotfiles that referenced this issue Dec 30, 2024
Don't update nixpkgs until NixOS/nixpkgs#368672 is fixed
@pbek
Copy link
Contributor

pbek commented Dec 30, 2024

Of course, because of this, packages like blender-hip and ollama with rocm acceleration are also failing to build.

@jhargraveiii
Copy link

maybe unrelated but amd-libflame fails - as well several cuda packages because of gcc14 (nvcc must use gcc13)

@collares
Copy link
Member

collares commented Jan 1, 2025

@pwaller Any change #356162 caused this? I haven't fully bisected it yet, but #356162 is in the current bisection range and it seems related.

@pwaller
Copy link
Contributor

pwaller commented Jan 1, 2025

It certainly seems possible. Hopefully it is trivial to try a revert and see if that fixes things? I will have little time to do this in the near future. /cc @emilazy who may be interested.

@emilazy
Copy link
Member

emilazy commented Jan 1, 2025

It seems unlikely to me, but I guess it depends on if the ROCm build system is doing weird things with unwrapped Clang.

Edit: Okay, it is using an unwrapped Clang. Try getting -nostdlibinc in the arguments, I suppose (NIX_CFLAGS_COMPILE if all else fails).

@pwaller
Copy link
Contributor

pwaller commented Jan 1, 2025

It seems unlikely to me, but I guess it depends on if the ROCm build system is doing weird things with unwrapped Clang.

Evidence for this, note the compiler is rocm-llvm-clang in the details block below -- with:

nix-build --arg overlays '[(self: super: { p = self.rocmPackages.llvm.libc.overrideAttrs (prev: { NIX_DEBUG = 1; } ); })]' /nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source -A p

I was able to get NIX_DEBUG into the args and see that -nostdlibinc is in the arguments. So the question is why it would be being inserted there.

NIX_DEBUG output in the expanded details below.

/build/source/libc/test/UnitTest/LibcTest.cpp:16:10: fatal error: 'cassert' file not found
#include <cassert>
         ^~~~~~~~~
1 error generated.
[32/322] Building CXX object libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o
HARDENING: disabled flags: pacret pie stackclashprotection fortify3 shadowstack fortify trivialautovarinit
HARDENING: Is active (not completely disabled with "all" flag)
HARDENING: enabling pic
HARDENING: enabling format
HARDENING: enabling zerocallusedregs
HARDENING: enabling stackprotector
HARDENING: enabling strictoverflow
extra flags before to /nix/store/dcakkwyrmphjj0vqdi7h8bd570mnv6pr-rocm-llvm-clang-unwrapped-6.0.2/bin/clang++:
  -fPIC
  -Wformat
  -Wformat-security
  -Werror=format-security
  -fzero-call-used-regs=used-gpr
  -fstack-protector-strong
  --param
  ssp-buffer-size=4
  -fwrapv
  -target
  x86_64-unknown-linux-gnu
original flags to /nix/store/dcakkwyrmphjj0vqdi7h8bd570mnv6pr-rocm-llvm-clang-unwrapped-6.0.2/bin/clang++:
  -D__STDC_CONSTANT_MACROS
  -D__STDC_FORMAT_MACROS
  -D__STDC_LIMIT_MACROS
  -I/build/source/libc
  -fvisibility-inlines-hidden
  -Werror=date-time
  -Werror=unguarded-availability-new
  -Wall
  -Wextra
  -Wno-unused-parameter
  -Wwrite-strings
  -Wcast-qual
  -Wmissing-field-initializers
  -Wimplicit-fallthrough
  -Wcovered-switch-default
  -Wno-noexcept-type
  -Wnon-virtual-dtor
  -Wdelete-non-virtual-dtor
  -Wsuggest-override
  -Wstring-conversion
  -Wmisleading-indentation
  -Wctad-maybe-unsupported
  -fdiagnostics-color
  -ffunction-sections
  -fdata-sections
  -O3
  -DNDEBUG
  -std=gnu++17
  -MD
  -MT
  libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o
  -MF
  libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o.d
  -o
  libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o
  -c
  /build/source/libc/test/UnitTest/TestLogger.cpp
extra flags after to /nix/store/dcakkwyrmphjj0vqdi7h8bd570mnv6pr-rocm-llvm-clang-unwrapped-6.0.2/bin/clang++:
  -B/nix/store/65h17wjrrlsj2rj540igylrx7fqcd6vq-glibc-2.40-36/lib/
  -idirafter
  /nix/store/kj8hbqx4ds9qm9mq7hyikxyfwwg13kzj-glibc-2.40-36-dev/include
  --gcc-toolchain=/nix/store/70bgv05075sxjgpm5s31kvpq35iip0fa-gcc-12.4.0
  -B/nix/store/dcakkwyrmphjj0vqdi7h8bd570mnv6pr-rocm-llvm-clang-unwrapped-6.0.2/lib
  -nostdlibinc
  -resource-dir=/nix/store/7sqn5142gh5asri8aqxvsvib9ii37fyq-rocm-llvm-clang-unwrapped-wrapper-6.0.2/resource-root
  -fuse-ld=lld
  -rtlib=compiler-rt
  -unwindlib=libunwind
  -Wno-unused-command-line-argument
  -B/nix/store/f1746bc8sw3banh3pnxsqmrzjh1jjy6i-rocm-llvm-binutils-wrapper-6.0.2/bin/
  -frandom-seed=a18fns3m5f
  -isystem
  /nix/store/17gplrlgbkpxzviwqg988n9ajybjaw4c-python3-3.12.8-env/include
  -isystem
  /nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/include
  -isystem
  /nix/store/8gq75qdv7yl0ci4icfyqi4nvgm47pcj4-rocm-llvm-runtimes-6.0.2/include
  -isystem
  /nix/store/129shslczvy20i9dg8986cvr4hal2zzz-rocm-llvm-llvm-6.0.2/include
  -isystem
  /nix/store/1lggwqzapn5mn49l9zy4h566ysv9kzdb-zlib-1.3.1-dev/include
  -isystem
  /nix/store/3lbb9lx1gmis6qm8clq9g9k37i5l8l52-ncurses-6.4.20221231-dev/include
  -isystem
  /nix/store/mkx2jc5qv43xni5a6zy7k2l862vjibzd-rocm-llvm-lld-6.0.2/include
  -isystem
  /nix/store/7hwyxbsi39mzrl4kmqs0m478wd2pg63x-libxml2-2.13.5-dev/include
  -isystem
  /nix/store/6cr0spsvymmrp1hj5n0kbaxw55w1lqyp-libxcrypt-4.4.36/include
  -isystem
  /nix/store/zrvw84q27y9dkly1d6980vn9j14b75lv-libedit-20240808-3.1-dev/include
  -isystem
  /nix/store/w661s7ai2rbh411r3w94fbfp802xnz8y-libffi-3.4.6-dev/include
  -isystem
  /nix/store/9hrap3ppvrdhivyazrvf04h4kqxlr9w2-mpfr-4.2.1-dev/include
  -isystem
  /nix/store/5p5arwim42ci73rkwr412p3ab3jj37ic-gmp-with-cxx-6.3.0-dev/include
  -isystem
  /nix/store/17gplrlgbkpxzviwqg988n9ajybjaw4c-python3-3.12.8-env/include
  -isystem
  /nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/include
  -isystem
  /nix/store/8gq75qdv7yl0ci4icfyqi4nvgm47pcj4-rocm-llvm-runtimes-6.0.2/include
  -isystem
  /nix/store/129shslczvy20i9dg8986cvr4hal2zzz-rocm-llvm-llvm-6.0.2/include
  -isystem
  /nix/store/1lggwqzapn5mn49l9zy4h566ysv9kzdb-zlib-1.3.1-dev/include
  -isystem
  /nix/store/3lbb9lx1gmis6qm8clq9g9k37i5l8l52-ncurses-6.4.20221231-dev/include
  -isystem
  /nix/store/mkx2jc5qv43xni5a6zy7k2l862vjibzd-rocm-llvm-lld-6.0.2/include
  -isystem
  /nix/store/7hwyxbsi39mzrl4kmqs0m478wd2pg63x-libxml2-2.13.5-dev/include
  -isystem
  /nix/store/6cr0spsvymmrp1hj5n0kbaxw55w1lqyp-libxcrypt-4.4.36/include
  -isystem
  /nix/store/zrvw84q27y9dkly1d6980vn9j14b75lv-libedit-20240808-3.1-dev/include
  -isystem
  /nix/store/w661s7ai2rbh411r3w94fbfp802xnz8y-libffi-3.4.6-dev/include
  -isystem
  /nix/store/9hrap3ppvrdhivyazrvf04h4kqxlr9w2-mpfr-4.2.1-dev/include
  -isystem
  /nix/store/5p5arwim42ci73rkwr412p3ab3jj37ic-gmp-with-cxx-6.3.0-dev/include

There is probably something obvious wrong here but I don't have a lot of attention on this right now.

@collares
Copy link
Member

collares commented Jan 2, 2025

There seems to be something fishy here:

I think libcxx-cxxflags only gets populated in the wrapper if libcxx is null or lib.isLLVM is true...

+ optionalString (libcxx.isLLVM or false) ''
echo "-isystem ${getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags
''

...but runtimes isn't a proper libcxx derivation:

{
lib,
stdenv,
callPackage,
rocmUpdateScript,
llvm,
}:
callPackage ../base.nix rec {
inherit stdenv rocmUpdateScript;
buildDocs = false;
buildMan = false;
buildTests = false;
targetName = "runtimes";
targetDir = targetName;
targetRuntimes = [
"libunwind"
"libcxxabi"
"libcxx"
"compiler-rt"
];
extraBuildInputs = [ llvm ];
extraCMakeFlags = [
"-DLIBCXX_INCLUDE_BENCHMARKS=OFF"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
extraLicenses = [ lib.licenses.mit ];
}

I don't understand enough to be sure, but libcxx = runtimes; feels like a bit of a hack to me. But just manually adding an isLLVM attribute to runtimes fixes the issue, so I will submit that as a workaround for now.

Edit: Opened #370180.

@GZGavinZhao
Copy link
Contributor

IMO the proper solution is that the ROCm LLVM should never itself be an stdenv, hence we don't even need to build libc, libcxx, libunwind, etc. The ROCm LLVM should be used solely for compiling HIP and therefore doesn't need all of those LLVM runtimes except compiler-rt. It can get the rest from stdenv.

We should just build a monolithic derivation of ROCm LLVM containing llvm, clang, lld, and compiler-rt (with a wrapCC to allow it to find libgcc/libc/libstdc++). When we need it to compile HIP code, just set CMAKE_CXX_COMPILER to hipcc or the wrapped clang. An additional advantage of this approach is that this separates the HIP compiler from the C/C++ compiler; namely, just because parts of the codebase uses HIP doesn't mean the entire thing needs to be compiled using the HIP compiler, which currently isn't the case. This may be particular helpful for packages like llama-cpp, where we can freely choose the C/C++ compiler that would bring the best performance for CPU inference while enabling HIP support.

See #370435 for an example of how this would work. The core changes (which I would consider simplifications) are in pkgs/development/rocm-modules/6/llvm/default.nix. Most derivations would not need changes except updating the broken field to query the HIP compiler version from ROCm LLVM instead of stdenv.cc.

@GZGavinZhao
Copy link
Contributor

I'm planning for #370435 to be merged after #367695 due to the large number of changes in #367695. If we think it's necessary for #370435 to be merged earlier, I'm happy to rebase #367695 on top of #370435.

@GZGavinZhao
Copy link
Contributor

Side note, to make the cc-wrapper logic of #370435 robust (i.e. to get rid of the extraBuildCommands that adds libcxx flags to the C compiler), I really want to do a one-line change to cc-wrapper.sh, but I would have to rebuild the entire world for that so perhaps not yet 😅

@emilazy
Copy link
Member

emilazy commented Jan 3, 2025

FWIW I really think that ROCm’s LLVM should be part of the main llvmPackages_* derivations if possible. It would help cut down on these kind of issues and divergences to use our existing LLVM build infrastructure if at all possible. We’re trying to accomplish something similar with Swift’s LLVM fork currently.

@ninelore
Copy link
Contributor

ninelore commented Jan 3, 2025

FYI this seems to affect rocmPackages_5 aswell

error: builder for '/nix/store/9l7mbqkfl1ip02zq0wkffwcpcmd7mcfz-rocm-llvm-libc-5.7.1.drv' failed with exit code 1;
       last 25 log lines:
       >   ^
       > 1 warning generated.
       > [7/322] Building CXX object libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o
       > FAILED: libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o
       > /nix/store/ms1026km7xhf0p64kifm1pxzgi0dkv2d-rocm-llvm-clang-unwrapped-wrapper-5.7.1/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -MD -MT libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o -MF libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o.d -o libc/utils/testutils/CMakeFiles/libc_test_utils.dir/ExecuteFunctionUnix.cpp.o -c /build/source/libc/utils/testutils/ExecuteFunctionUnix.cpp
       > /build/source/libc/utils/testutils/ExecuteFunctionUnix.cpp:10:10: fatal error: 'cassert' file not found
       > #include <cassert>
       >          ^~~~~~~~~
       > 1 error generated.
       > [8/322] Building CXX object libc/src/stdio/printf_core/CMakeFiles/libc.src.stdio.printf_core.writer.dir/writer.cpp.o
       > [9/322] Building CXX object libc/src/ctype/CMakeFiles/libc.src.ctype.isalnum.dir/isalnum.cpp.o
       > [10/322] Building CXX object libc/src/__support/CPP/CMakeFiles/libc.src.__support.CPP.new.dir/new.cpp.o
       > [11/322] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.math_utils.dir/math_utils.cpp.o
       > [12/322] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.signal_to_string.dir/signal_to_string.cpp.o
       > [13/322] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/error_to_string.cpp.o
       > [14/322] Building CXX object libc/src/__support/File/CMakeFiles/libc.src.__support.File.file.dir/file.cpp.o
       > [15/322] Building CXX object libc/test/UnitTest/CMakeFiles/LibcUnitTest.dir/LibcTest.cpp.o
       > FAILED: libc/test/UnitTest/CMakeFiles/LibcUnitTest.dir/LibcTest.cpp.o
       > /nix/store/ms1026km7xhf0p64kifm1pxzgi0dkv2d-rocm-llvm-clang-unwrapped-wrapper-5.7.1/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/build/source/libc -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -MD -MT libc/test/UnitTest/CMakeFiles/LibcUnitTest.dir/LibcTest.cpp.o -MF libc/test/UnitTest/CMakeFiles/LibcUnitTest.dir/LibcTest.cpp.o.d -o libc/test/UnitTest/CMakeFiles/LibcUnitTest.dir/LibcTest.cpp.o -c /build/source/libc/test/UnitTest/LibcTest.cpp
       > /build/source/libc/test/UnitTest/LibcTest.cpp:16:10: fatal error: 'cassert' file not found
       > #include <cassert>
       >          ^~~~~~~~~
       > 1 error generated.
       > [16/322] Building CXX object libc/test/UnitTest/CMakeFiles/TestLogger.dir/TestLogger.cpp.o
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/9l7mbqkfl1ip02zq0wkffwcpcmd7mcfz-rocm-llvm-libc-5.7.1.drv'.
error (ignored): error: cannot unlink '"/tmp/nix-build-rocm-llvm-compiler-rt-5.7.1.drv-0/build/source"': Directory not empty
error: 1 dependencies of derivation '/nix/store/0i7p5jqxjz635i29gqi2csksln1db7yz-rocm-llvm-clang-wrapper-5.7.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d9b8385h5ndxbh66j5b3ayhwqx6lw9z6-clr-5.7.1.drv' failed to build

@collares
Copy link
Member

collares commented Jan 3, 2025

@ninelore Can you try again on master?

@ninelore
Copy link
Contributor

ninelore commented Jan 3, 2025

@ninelore Can you try again on master?

lgtm

@mastoca
Copy link
Contributor

mastoca commented Jan 3, 2025

Seeing the same issue here as well #365718

@collares
Copy link
Member

collares commented Jan 3, 2025

Seeing the same issue here as well #365718

What commit are you testing? Does rebasing on top of current master help?

@rjpcasalino
Copy link
Contributor

hasn't hit unstable yet https://nixpk.gs/pr-tracker.html?pr=370180

@mastoca
Copy link
Contributor

mastoca commented Jan 4, 2025

@collares I see it's hit nixos-unstable-small I'm testing against that right now and the build has gotten further than before. Will report on success/fail after I complete a few tests.

@collares
Copy link
Member

collares commented Jan 4, 2025

Thanks! It might be best to file follow-up issues or to discuss failures in the ollama PR, depending on where the problem is.

@rjpcasalino
Copy link
Contributor

hey, it works! many thanks

@HuzaifaTP
Copy link

HuzaifaTP commented Jan 22, 2025

not sure if its related but encountered this on updating unstable and rebuilding:

  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp
  llvm-libc++-shared.cfg.in :: std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp
  llvm-libc++-shared.cfg.in :: std/utilities/function.objects/func.invoke/invoke_r.temporary.verify.cpp

********************
Failed Tests (1):
  llvm-libc++-shared.cfg.in :: libcxx/transitive_includes.sh.cpp


Testing Time: 2782.86s

Total Discovered Tests: 7869
  Unsupported      :  428 (5.44%)
  Passed           : 7400 (94.04%)
  Expectedly Failed:   40 (0.51%)
  Failed           :    1 (0.01%)
FAILED: CMakeFiles/check-runtimes /build/source/runtimes/build/CMakeFiles/check-runtimes
cd /build/source/runtimes/build && /nix/store/inqsga0i9wl1z80xwiq4nijbrnpqz6b4-python3-3.12.8-env/bin/python3.12 /nix/store/9rqf51h9yhz3q2y1in0ql12xl2vibg00-python3.12-lit-18.1.8/bin/.lit-wrapped -sv --show-xfail --show-unsupported /build/source/runtimes/build/libcxx/test
ninja: build stopped: subcommand failed.
error: builder for '/nix/store/35a4dhaa1b27dcscz6qnj97a15qma2bx-rocm-llvm-libcxx-6.0.2.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/wjf41g7sfn87s9s1x0apffcb034s5k6b-rocm-llvm-clang-wrapper-6.0.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lcsrng48sryasfhzcgm5r3m2zs16ri6a-clr-6.0.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fl29p5hq0a638c791g8big77aaz03wg0-rocm-clang.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hs892zry0nf41pp65xr991w4xjhfh378-rocm-llvm-openmp-6.0.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1wqp3mwbqg5rz8f5hj26npf9j1xasf18-stdenv-linux.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xs7k2bwasf72rz0mmy4dcvnhgrcp1icd-graphics-drivers.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rnqmkd85jsx7jqj35y5j9j7x2pq7yrx8-ollama-0.5.7.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q31qri5xc3fhvnhwrxwdfnkck89r6y8m-graphics-driver.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xjc78q4p9s5kclzqyl48g18phlmg4nwb-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qlkindfrbccs2zy2ywdnfayjwcsprpc4-unit-ollama.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r9q92vrslbhmr60yw8xh0iivqg3i2dv8-unit-script-ollama-model-loader-start.drv' failed to build
error: 1 dependencies of derivation '/nix/store/z99gdg97bhi73clfmh33lf6gfrimp7qp-nixos-system-latitude2-25.05beta742084.9e4d5190a948.drv' failed to build

amd gpu + rocm config:

{pkgs,...}:

{
      systemd.packages = with pkgs; [ lact ];
      systemd.services.lactd.wantedBy = ["multi-user.target"];
      hardware.amdgpu.amdvlk.enable = false;
services.ollama = {
  enable = true;
  loadModels = [ "codellama" "llama3.2" ];
  acceleration = "rocm";
  rocmOverrideGfx = "10.1.1";
    environmentVariables = {
       HCC_AMDGPU_TARGET = "gfx1100";
     };
};
      hardware.amdgpu.opencl.enable = true;
      hardware.graphics = {
        enable = true;
        enable32Bit = true;
        extraPackages = with pkgs; [
                 mesa
                 rocmPackages.rocblas
                 rocmPackages.rocm-smi
                 rocmPackages.rocminfo
                 rocmPackages.hipblas
                 rocmPackages.rocm-device-libs
                 rocmPackages.rpp
                 pcre2
                 libselinux
                 libcap
        ];
      };
}

@adamcstephens
Copy link
Contributor

This failure is for a different package, and probably a different failure. Please open a new ticket instead.

pbek added a commit to pbek/nixcfg that referenced this issue Jan 22, 2025
…a again, because of kernel 6.13

Signed-off-by: Patrizio Bekerle <[email protected]>
@pbek
Copy link
Contributor

pbek commented Jan 22, 2025

Of course, because of this, packages like blender-hip and ollama with rocm acceleration are also failing to build.

For kernel 6.12 this issue was fixed for me, with kernel 6.13 I get the llvm errors again. 😅

@rjpcasalino
Copy link
Contributor

yeah, I just had to switch back to stable - find it hard to be without ollama - very good tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.