Hi everyone,
I’m trying to compile an external library to my program with nvc/nvc++ but I get these errors:
I hope someone can help me
Hi everyone,
I’m trying to compile an external library to my program with nvc/nvc++ but I get these errors:
Likely due to this section in starting at line 1670 of “PacketMath.h”. We added support for the m128 intrinsics a bit ago so this redefinition is no longer needed.
However, it appears that the code does check the compiler version, so I’m not sure why these would still be included. Possibly due to our rebranding from PGI to NVHPC? Not sure.
You might want to ask the Eigen folks since they’ll have a better understand.
#if EIGEN_COMP_PGI && EIGEN_COMP_PGI < 1900
// PGI++ does not define the following intrinsics in C++ mode.
static inline __m128 _mm_castpd_ps (__m128d x) { return reinterpret_cast<__m128&>(x); }
static inline __m128i _mm_castpd_si128(__m128d x) { return reinterpret_cast<__m128i&>(x); }
static inline __m128d _mm_castps_pd (__m128 x) { return reinterpret_cast<__m128d&>(x); }
static inline __m128i _mm_castps_si128(__m128 x) { return reinterpret_cast<__m128i&>(x); }
static inline __m128 _mm_castsi128_ps(__m128i x) { return reinterpret_cast<__m128&>(x); }
static inline __m128d _mm_castsi128_pd(__m128i x) { return reinterpret_cast<__m128d&>(x); }
#endif
-Mat
Hi Mat,
thanks for the reply I solved the problem by following your old post:
https://forums.developer.nvidia.com/t/error-compiling-with-eigen-library/136246
The program works now but I have one more question, in the early stages I’m using unified memory to avoid using explicit data copying. When I launch the program, it works but I have this statement:
memalign: call to cuMemAllocManaged returned error 1: Invalid value
Is there a way to figure out which value is creating the error? Because then if I try to add other openacc directives in the code I get segmentation errors and I would like to understand if it is that value that creates these problems for me.
thanks for the reply I solved the problem by following your old post:
Ah, yes. I knew I’d seen this before. It looks like they updated the code to at least attempt to only use this with older compiler versions, but I’m not sure how they are determining the “EIGEN_COMP_PGI” value.
Is there a way to figure out which value is creating the error?
You’ll likely need to run the code through a debugger, like gdb, and see if it interrupts on the error or if you can put in breaks to track it down. This wont show which variable is getting allocated, but might show the value being used.
You can try the ‘compute-sanitizer’ utility as well, but since this is coming from the host side, doubt it will be able to help.
When using the “-gpu=managed” flag, the compile will replace visible allocation calls (i.e. malloc, new, etc.) with calls to cudaMallocManaged. I don’t see any direct calls to memalign, so assume it gets called through one of the aligned malloc calls.
Hi Matt,
I tried to use nvidia’s compute-sanitizer tool and
compute-sanitizer --log-file memory2 SU2_CFD inv_NACA0012.cfg
I got this as a result
memory2 (733.2 KB)
if i understand correctly, from what i found online, the Host_Frame report the path to the error?
I believe so. However when I grabbed “allocation_toolbox.hpp” from SU2 and put it in an example program, I was unable to reproduce the error.
I thought it might be a problem with how we’re replacing the aligned_alloc with aligned_alloc_managed, but it it doesn’t seems so, at least for generic use. Though there might be something specific which SU2 which is causing it.
I can try building and running SU2, but I’m a bit swamped right now, so may not be able to get to it any time soon. Hence, if you can do more analysis to determine why this is occurring, that would be appreciated.
-Mat