_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Alex :
Can you please try `numactl` or `taskset` after https://github.com/llvm/llvm-project/commit/09158252f777c2e2f06a86b154c44abcbcf9bb74 ?
There was a tiny bug in how sched_getaffinity() was used, see: https://reviews.llvm.org/D75153#1942336
De : Alex Brachet-Mialot <alexbrac...@gmail.com>
Envoyé : March 28, 2020 12:11 PM
À : Itaru Kitayama <itaru.k...@gmail.com>
Cc : LLVM Dev <llvm...@lists.llvm.org>; Alexandre Ganea <alexand...@ubisoft.com>; Fāng-ruì Sòng <mas...@google.com>
Objet : Re: [llvm-dev] LLD issue on a massively parallel build machine
> Can you please try `numactl` or `taskset` after https://github.com/llvm/llvm-project/commit/09158252f777c2e2f06a86b154c44abcbcf9bb74 ?
It works! I can finally use lld on that machine :)
Would `taskset -c 0-3 ninja check-all -j4` work?
De : Itaru Kitayama <itaru.k...@gmail.com>
Envoyé : March 28, 2020 3:37 PM
À : Alex Brachet-Mialot <alexbrac...@gmail.com>
Cc : Alexandre Ganea <alexand...@ubisoft.com>; LLVM Dev <llvm...@lists.llvm.org>; Nemanja Ivanovic <nemanj...@gmail.com>
https://reviews.llvm.org/D76885 (committed yesterday) changed
--no-threads to --threads={1,2,...} (--no-threads is used rarely (GNU ld
does not support it) so I'd rather not keep the option for
compatibility).
You may try -Wl,--threads=1
>On Sat., Mar. 28, 2020, 4:19 p.m. Itaru Kitayama, <itaru.k...@gmail.com>
>wrote:
>
>> Good news, I was able to use up to 37 cores for LLVM build with LLD.
>> The build speed, did not measure precisely though, is comparable to the
>> build with GNU ld case.
>>
>> Thank you all for your help!
>>
>> On Sun, Mar 29, 2020 at 5:04 AM Alex Brachet-Mialot <
>> alexbrac...@gmail.com> wrote:
>>
>>> Yes unfortunately that would limit you to 4 cores.
>>>
>>> There’s no easy way to use lld with —no-threads with our build system at
>>> the moment unfortunately.
>>>
>>> I also had just been using ld.gold, but will switch now that numactl
>>> works for me.
>>>
>>> On Sat, Mar 28, 2020 at 3:58 PM Itaru Kitayama <itaru.k...@gmail.com>
>>> wrote:
>>>
>>>> That is slowing down the build visibly, for the speed I should stick
>>>> with ld at the moment.
>>>>
>>>>
>>>> On Sun, Mar 29, 2020 at 4:42 AM Alexandre Ganea <
>>>> alexand...@ubisoft.com> wrote:
>>>>
>>>>> Would `taskset -c 0-3 ninja check-all -j4` work?
>>>>>
>>>>>
>>>>>
>>>>> *De :* Itaru Kitayama <itaru.k...@gmail.com>
>>>>> *Envoyé :* March 28, 2020 3:37 PM
>>>>> *À :* Alex Brachet-Mialot <alexbrac...@gmail.com>
>>>>> *Cc :* Alexandre Ganea <alexand...@ubisoft.com>; LLVM Dev <
>>>>> llvm...@lists.llvm.org>; Nemanja Ivanovic <nemanj...@gmail.com>
>>>>> *Objet :* Re: [llvm-dev] LLD issue on a massively parallel build
>>>>> There was a tiny bug in how *sched_getaffinity*() was used, see:
>>>>> https://reviews.llvm.org/D75153#1942336
>>>>>
>>>>>
>>>>>
>>>>> *De :* Alex Brachet-Mialot <alexbrac...@gmail.com>
>>>>> *Envoyé :* March 28, 2020 12:11 PM
>>>>> *À :* Itaru Kitayama <itaru.k...@gmail.com>
>>>>> *Cc :* LLVM Dev <llvm...@lists.llvm.org>; Alexandre Ganea <
>>>>> alexand...@ubisoft.com>; Fāng-ruì Sòng <mas...@google.com>
>>>>> *Objet :* Re: [llvm-dev] LLD issue on a massively parallel build
This doesn't look to me like it's necessarily an lld issue. Trying
to build all the sub-projects without limiting the number of ninja jobs
is almost guaranteed to run out of memory on a machine like this with such
a low memory:core ratio.
-Tom
> On Thu, Apr 2, 2020 at 1:49 Fangrui Song <mas...@google.com <mailto:mas...@google.com>> wrote:
>
> On 2020-03-29, Nemanja Ivanovic via llvm-dev wrote:
> >Glad you got it working.
> >My suggestion about LLVM_ENABLE_THREADS didn't work because you didn't
> >apply it when building the build linker.
> >
> >When you don't have the ability to rebuild the build compiler, this doesn't
> >apply. In those cases, I end up doing a dirty hack where I use a wrapper
> >script with something like:
> >
> ><path-to-build-compiler> "$@" -Wl,--no-threads
> >
> >To invoke the build compiler. That way you still get full parallelism while
> >compiling and linking, but you prevent LLD from using threads.
>
>
> https://reviews.llvm.org/D76885 (committed yesterday) changed
> --no-threads to --threads={1,2,...} (--no-threads is used rarely (GNU ld
> does not support it) so I'd rather not keep the option for
> compatibility).
>
> You may try -Wl,--threads=1
>
> >On Sat., Mar. 28, 2020, 4:19 p.m. Itaru Kitayama, <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>
> >wrote:
> >
> >> Good news, I was able to use up to 37 cores for LLVM build with LLD.
> >> The build speed, did not measure precisely though, is comparable to the
> >> build with GNU ld case.
> >>
> >> Thank you all for your help!
> >>
> >> On Sun, Mar 29, 2020 at 5:04 AM Alex Brachet-Mialot <
> >> alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>> wrote:
> >>
> >>> Yes unfortunately that would limit you to 4 cores.
> >>>
> >>> There’s no easy way to use lld with —no-threads with our build system at
> >>> the moment unfortunately.
> >>>
> >>> I also had just been using ld.gold, but will switch now that numactl
> >>> works for me.
> >>>
> >>> On Sat, Mar 28, 2020 at 3:58 PM Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>
> >>> wrote:
> >>>
> >>>> That is slowing down the build visibly, for the speed I should stick
> >>>> with ld at the moment.
> >>>>
> >>>>
> >>>> On Sun, Mar 29, 2020 at 4:42 AM Alexandre Ganea <
> >>>> alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>> wrote:
> >>>>
> >>>>> Would `taskset -c 0-3 ninja check-all -j4` work?
> >>>>>
> >>>>>
> >>>>>
> >>>>> *De :* Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>
> >>>>> *Envoyé :* March 28, 2020 3:37 PM
> >>>>> *À :* Alex Brachet-Mialot <alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>>
> >>>>> *Cc :* Alexandre Ganea <alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>>; LLVM Dev <
> >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>; Nemanja Ivanovic <nemanj...@gmail.com <mailto:nemanj...@gmail.com>>
> >>>>> *De :* Alex Brachet-Mialot <alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>>
> >>>>> *Envoyé :* March 28, 2020 12:11 PM
> >>>>> *À :* Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>
> >>>>> *Cc :* LLVM Dev <llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>; Alexandre Ganea <
> >>>>> alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>>; Fāng-ruì Sòng <mas...@google.com <mailto:mas...@google.com>>
> >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>
> >>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >>>>>
> >>>>> _______________________________________________
> >>>>> LLVM Developers mailing list
> >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>
> >>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >>>>>
> >>>>>
>
> >_______________________________________________
> >LLVM Developers mailing list
> >llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>
It really depends on your configuration, but I usually try to have at least 2 GB
of memory per core. However, I usually do Release builds, so Debug builds might
need more. If you aren't using LLVM_PARALLEL_LINK_JOBS it's pretty easy to
run out of memory once ninja starts linking the tools and unittests.
-Tom
> On Thu, Apr 2, 2020 at 6:11 Tom Stellard <tste...@redhat.com <mailto:tste...@redhat.com>> wrote:
>
> On 04/01/2020 01:47 PM, Itaru Kitayama via llvm-dev wrote:
> > Thanks for the heads up the supercomputer
> > Is down for maintenance this week.
> > I’ll give it a try when it gets back.
> >
>
> This doesn't look to me like it's necessarily an lld issue. Trying
> to build all the sub-projects without limiting the number of ninja jobs
> is almost guaranteed to run out of memory on a machine like this with such
> a low memory:core ratio.
>
> -Tom
>
> > On Thu, Apr 2, 2020 at 1:49 Fangrui Song <mas...@google.com <mailto:mas...@google.com> <mailto:mas...@google.com <mailto:mas...@google.com>>> wrote:
> >
> > On 2020-03-29, Nemanja Ivanovic via llvm-dev wrote:
> > >Glad you got it working.
> > >My suggestion about LLVM_ENABLE_THREADS didn't work because you didn't
> > >apply it when building the build linker.
> > >
> > >When you don't have the ability to rebuild the build compiler, this doesn't
> > >apply. In those cases, I end up doing a dirty hack where I use a wrapper
> > >script with something like:
> > >
> > ><path-to-build-compiler> "$@" -Wl,--no-threads
> > >
> > >To invoke the build compiler. That way you still get full parallelism while
> > >compiling and linking, but you prevent LLD from using threads.
> >
> >
> > https://reviews.llvm.org/D76885 (committed yesterday) changed
> > --no-threads to --threads={1,2,...} (--no-threads is used rarely (GNU ld
> > does not support it) so I'd rather not keep the option for
> > compatibility).
> >
> > You may try -Wl,--threads=1
> >
> > >On Sat., Mar. 28, 2020, 4:19 p.m. Itaru Kitayama, <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com> <mailto:itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>>
> > >wrote:
> > >
> > >> Good news, I was able to use up to 37 cores for LLVM build with LLD.
> > >> The build speed, did not measure precisely though, is comparable to the
> > >> build with GNU ld case.
> > >>
> > >> Thank you all for your help!
> > >>
> > >> On Sun, Mar 29, 2020 at 5:04 AM Alex Brachet-Mialot <
> > >> alexbrac...@gmail.com <mailto:alexbrac...@gmail.com> <mailto:alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>>> wrote:
> > >>
> > >>> Yes unfortunately that would limit you to 4 cores.
> > >>>
> > >>> There’s no easy way to use lld with —no-threads with our build system at
> > >>> the moment unfortunately.
> > >>>
> > >>> I also had just been using ld.gold, but will switch now that numactl
> > >>> works for me.
> > >>>
> > >>> On Sat, Mar 28, 2020 at 3:58 PM Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com> <mailto:itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>>
> > >>> wrote:
> > >>>
> > >>>> That is slowing down the build visibly, for the speed I should stick
> > >>>> with ld at the moment.
> > >>>>
> > >>>>
> > >>>> On Sun, Mar 29, 2020 at 4:42 AM Alexandre Ganea <
> > >>>> alexand...@ubisoft.com <mailto:alexand...@ubisoft.com> <mailto:alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>>> wrote:
> > >>>>
> > >>>>> Would `taskset -c 0-3 ninja check-all -j4` work?
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> *De :* Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com> <mailto:itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>>
> > >>>>> *Envoyé :* March 28, 2020 3:37 PM
> > >>>>> *À :* Alex Brachet-Mialot <alexbrac...@gmail.com <mailto:alexbrac...@gmail.com> <mailto:alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>>>
> > >>>>> *Cc :* Alexandre Ganea <alexand...@ubisoft.com <mailto:alexand...@ubisoft.com> <mailto:alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>>>; LLVM Dev <
> > >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org> <mailto:llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>>; Nemanja Ivanovic <nemanj...@gmail.com <mailto:nemanj...@gmail.com> <mailto:nemanj...@gmail.com <mailto:nemanj...@gmail.com>>>
> > >>>>> *De :* Alex Brachet-Mialot <alexbrac...@gmail.com <mailto:alexbrac...@gmail.com> <mailto:alexbrac...@gmail.com <mailto:alexbrac...@gmail.com>>>
> > >>>>> *Envoyé :* March 28, 2020 12:11 PM
> > >>>>> *À :* Itaru Kitayama <itaru.k...@gmail.com <mailto:itaru.k...@gmail.com> <mailto:itaru.k...@gmail.com <mailto:itaru.k...@gmail.com>>>
> > >>>>> *Cc :* LLVM Dev <llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org> <mailto:llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>>; Alexandre Ganea <
> > >>>>> alexand...@ubisoft.com <mailto:alexand...@ubisoft.com> <mailto:alexand...@ubisoft.com <mailto:alexand...@ubisoft.com>>>; Fāng-ruì Sòng <mas...@google.com <mailto:mas...@google.com> <mailto:mas...@google.com <mailto:mas...@google.com>>>
> > >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org> <mailto:llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>
> > >>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> > >>>>>
> > >>>>> _______________________________________________
> > >>>>> LLVM Developers mailing list
> > >>>>> llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org> <mailto:llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>
> > >>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> > >>>>>
> > >>>>>
> >
> > >_______________________________________________
> > >LLVM Developers mailing list
> > >llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org> <mailto:llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>>
Passing -Wl,--threads=1 via -DCMAKE_CXX_FLAGS causes a config error.-- Check for working CXX compiler: /home/usr4/c74014i/opt/clang/current/bin/clang++ -- broken
CMake Error at /home/usr4/c74014i/opt/cmake-3.16.3-Linux-x86_64/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler
"/home/usr4/c74014i/opt/clang/current/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /tmp/202004040902/CMakeFiles/CMakeTmp
Run Build Command(s):/home/usr4/c74014i/opt/ninja/bin/ninja cmTC_9430a && [1/2] Building CXX object CMakeFiles/cmTC_9430a.dir/testCXXCompiler.cxx.o
clang-11: warning: -Wl,--threads=1: 'linker' input unused [-Wunused-command-line-argument]
[2/2] Linking CXX executable cmTC_9430a
FAILED: cmTC_9430a
: && /home/usr4/c74014i/opt/clang/current/bin/clang++ -Wl,--threads=1 CMakeFiles/cmTC_9430a.dir/testCXXCompiler.cxx.o -o cmTC_9430a && :
/usr/bin/ld: unrecognized option '--threads=1'
/usr/bin/ld: use the --help option for usage information
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Setting LLVM_PARALLEL_LINK_JOBSdid not help a week or two weeks ago’s lld.But recent commits to lld might reflect the variable correctly.
_______________________________________________
Then I’d suggest this should be renamed.IMO it’s pretty much confusing.it’s so easy to set ninja parallelism with the direct -j option as all we know.