Problem compiling with nvc++, in the ASM , Error: junk at end of line ",unique,1"?

So I’m compiling using

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Thu_Feb_10_18:23:41_PST_2022
Cuda compilation tools, release 11.6, V11.6.112
Build cuda_11.6.r11.6/compiler.30978841_0


nvc++ 22.3-0 64-bit target on x86-64 Linux -tp zen2
NVIDIA Compilers and Tools
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SC(double, double &, double &, double &, double &):
1, include “”
1016, Generating NVIDIA GPU code
Special_Astro_TripleProduct(Vector3 &, const Vector3 &, const Vector3 &, const Vector3 &):
1, include “”
Vector3::CrossProduct(const Vector3&, const Vector3&):
1, include “”
Vector3::mag() const:
1, include “”
Vector3::dot(const Vector3&) const:
1, include “”
obj/Util/astro.s: Assembler messages:
obj/Util/astro.s:4000: Error: junk at end of line, first unrecognized character is `,’
obj/Util/astro.s:4000: Warning: ignoring changed section attributes for .nvFatBinSegment

nvc++ -DDSFMT_MEXP=19937 -DUSE_MYSQL -I/usr/local/cuda/include -IHeaders -ta:tesla:cc70,managed -Minfo=accel -I/usr/include/mysql -Mkeepasm -c -o obj/Util/astro.o /tmp/

When I look at line 4000 of obj/Util/astro.s… it looks like this?

.size	.Y0001.42794, 255152

.type	.Y0002.42795,@object            # @.Y0002.42795
.section	.nvFatBinSegment,"a",@progbits,unique,1
.p2align	3

I assume “,unique,1” is the issue. Why is this happening, any way to fix/avoid this issue to get me compiling?

I have not seen this before so will need to investigate. Do you have a reproducing example?

-Mat (2.3 KB)

Here’s a small example that causes this condition. You’ll note that I load a few external libraries and compile using NVCC and NVC++ which is not necessary with this simple example. However, this is is because I’ve removed a lot of unrelated code to reproduce this bug. Hopefully you can reproduce and fix this without changing the included libraries and NVCC + NVC++ compile chain.


Thanks Carl. I was able to reproduce the error in 22.3 as well as 22.7, but it no longer occurs in our pre-release 22.9 (22.9 will be released in the near future). This line from the 22.9 generated assembly did not change, but it looks like we have added additional CUDA support in nvc++ that may have fixed the issue.

Is there a reason why you’re using nvcc to preprocess the file? While still a work in progress and limited, nvc++ does have some support for compiling CUDA (by adding the “-cuda” flag). Can you try compiling your CUDA file directly with nvc++?

Also, nvc++ enables Relocatable Device Code (RDC) by default. However RDC requires a device code link step which wont be performed here since you’re using g++ to link. You will need to either link with nvc++ or disable RDC by adding “-gpu=nordc” to your compilation. The caveat being that if you disable RDC a few OpenACC features wont be available, namely calling device routines in separate file or access to global device variables.