microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.2k stars 6.39k forks source link

[onednn[core]:x64-linux] build failure #19205

Closed Henderz closed 2 years ago

Henderz commented 3 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install onednn[core]:x64-linux [install-x64-linux-dbg-out.log](https://github.com/microsoft/vcpkg/files/6894758/install-x64-linux-dbg-out.log)

Failure logs

The following packages will be built and installed:
    onednn[core]:x64-linux -> 2.0#1
Detecting compiler hash for triplet x64-linux...
Could not locate cached archive: /root/.cache/vcpkg/archives/13/13a8bf92468e78b15ce50b4b18ebec156a3bc3c042d193889ba596f600507a30.zip
Starting package 1/1: onednn:x64-linux
Building package onednn[core]:x64-linux...
-- Using /home/rin/Documents/Workspace/vcpkg/downloads/oneapi-src-oneDNN-v2.0.tar.gz
-- Cleaning sources at /home/rin/Documents/Workspace/vcpkg/buildtrees/onednn/src/v2.0-80e0c80e79.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/rin/Documents/Workspace/vcpkg/downloads/oneapi-src-oneDNN-v2.0.tar.gz
-- Using source at /home/rin/Documents/Workspace/vcpkg/buildtrees/onednn/src/v2.0-80e0c80e79.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:155 (message):
    Command failed: /home/rin/Documents/Workspace/vcpkg/downloads/tools/cmake-3.20.2-linux/cmake-3.20.2-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j25
    Working Directory: /home/rin/Documents/Workspace/vcpkg/buildtrees/onednn/x64-linux-dbg
    See logs for more information:
      /home/rin/Documents/Workspace/vcpkg/buildtrees/onednn/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:104 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:44 (vcpkg_build_cmake)
  ports/onednn/portfile.cmake:20 (vcpkg_install_cmake)
  scripts/ports.cmake:141 (include)

Error: Building package onednn:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: onednn:x64-linux
  Vcpkg version: 2021-07-26-unknownhash
autoantwort commented 3 years ago

/home/rin/Documents/Workspace/vcpkg/buildtrees/onednn/install-x64-linux-dbg-out.log

Please provide the logs :)

Henderz commented 3 years ago

Sorry, I thought I did. install-x64-linux-dbg-out.log

autoantwort commented 3 years ago

from the log: collect2: fatal error: ld terminated with signal 9 [Killed], after a few seconds of googling it seems that your system ran out of memory

Henderz commented 3 years ago

Oh.. that makes sense.. My system does freeze midway during the build and eventually when it recovers, I see this error. But then I have a 32 GB RAM.. Is there something I can do to prevent this?

autoantwort commented 3 years ago

Hm, maybe restart your pc so that the initial memory usage is low. How many cores do you have?

Henderz commented 3 years ago

Thanks for binging my attention to the relavent error. I didn't think this line meant anything. I will google and try other solutions like increasing Swap disk or running "cargo run --release --verbose --jobs 1" whatever that does ;)

I have tried restarting and having this as the only frontend process running. I have 12 cores - an AMD Ryzen 9 3900X.

dg0yt commented 3 years ago

12 core, 25 jobs, this isn't much average RAM per job. You may try to limit the job count via VCPKG_MAX_CONCURRENCY.

Henderz commented 3 years ago

12 core, 25 jobs, this isn't much average RAM per job. You may try to limit the job count via VCPKG_MAX_CONCURRENCY.

12 core, 25 jobs, this isn't much average RAM per job. You may try to limit the job count via VCPKG_MAX_CONCURRENCY.

Thank you for you suggestion @dg0yt. I tried setting this to 8 in the vcpkg.cmake file with the following statement. set(VCPKG_MAX_CONCURRENCY 8)

It didn't help. The system froze again for a long time before I force rebooted. Am I setting this correctly? Is there anything else I can try?

JackBoosY commented 3 years ago

See https://github.com/microsoft/vcpkg/blob/bec883fef498206f05b20bc0a4ba241637657dba/docs/users/config-environment.md#vcpkg_max_concurrency.

JackBoosY commented 2 years ago

We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.

Henderz commented 2 years ago

Yes, Thank you. Although I don't recall now what I did to get the build, I'm sure it was your observation that RAM would be split between different threads and limiting concurrency were key in solving it. Thank you! :-)

dg0yt commented 2 years ago

Last not least, VCPKG_MAX_CONCURRENCY is an environment variable.