2

This command works fine (with the -G option):

nvcc test.cu -o test -Iinclude -I../boost_1_79_0 -std=c++20 --expt-relaxed-constexpr -DNDEBUG -arch=sm_86 -G

But if I remove the -G option, the nvcc compiler will take a few minutes to compile. I also tried to replace -G with -Xptxas -O0 that turns off all the optimization, but it still got in stuck.

When it gets stuck, if I press ctrl + c, it outputs: nvcc error : 'cicc' died due to signal 2

My code uses a lot of CPP20-featured templates. My NVCC version is V12.0.76, and g++ version is 11.3.0.

What is the possible reason for it?

I expect it will compile and work normally for both debug and release modes.

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
Karbo Lei
  • 21
  • 1
  • 1
    How long is forever? – Retired Ninja May 15 '23 at 06:03
  • @RetiredNinja Oh you are right, thanks the suggestion, it is my fault. With "-G" flag, it compiles less than one second, but without the flag, it takes several minutes, but it can eventually compile it successfully though the time is a bit long. – Karbo Lei May 15 '23 at 06:12
  • 2
    Back in the Pentium 90 Dos4GW days we had a typo in our makefile that turned optimization off. A full compile took a couple of minutes. Fixed the bug and after 10 minutes decided the computer was hung and rebooted it. Next time we rebooted it at 20 minutes. Then we went to dinner. It finished after ~90 minutes. Optimization is hard work. – Retired Ninja May 15 '23 at 06:27
  • 2
    I'd check you're not running out of memory, that's often a cause for unusually long compiles in my experience – Alan Birtles May 15 '23 at 07:12
  • 2
    It looks like you are trying to compile boost with nvcc. Don't do that – talonmies May 15 '23 at 07:22
  • A possible reason for it is that `nvcc` is an optimizing compiler, and various optimization efforts require additional processing time. For the `-G` case, you're indicating for the most part "no optimization" so these additional time-consuming optimization tasks don't need to be performed by the compiler, which can shorten the compilation time. – Robert Crovella May 15 '23 at 14:38

0 Answers0