Skip to content

Compatibility issues with NVIDIA compilers. #6

Description

@olupton

We have recently noticed two issues with Random123 compatibility with the NVIDIA HPC SDK compilers (formerly PGI).

The first issue is that recent versions (21.11+) of nvc and nvc++ are more enthusiastic about detecting and enabling support for ABM instructions (see: https://forums.developer.nvidia.com/t/21-11-tp-behaviour/198115). This is problematic because Random123 assumes that if ABM/__ABM__ is enabled then intrin.h will be available, which is a poor assumption:

#ifndef R123_USE_INTRIN_H
#ifdef __ABM__
#define R123_USE_INTRIN_H 1
#else
#define R123_USE_INTRIN_H 0
#endif
#endif

This is not correct both on our systems and those of some of our users, and leads to errors such as

"include/Random123/features/sse.h", line 56: catastrophic error #1697: cannot open source file "intrin.h"
  #include <intrin.h>
                     ^

A second issue is that recent versions of nvc and nvc++ support a -cuda option, which is required when compiling for certain types of GPU offload. When invoked in this mode, the compilers define the __CUDACC__ macro, which means they are detected as nvcc instead of PGI-like compilers:

#elif defined(__CUDACC__)
#include "nvccfeatures.h"
#elif defined(__ICC)
#include "iccfeatures.h"
#elif defined(__xlC__) || defined(__ibmxl__)
#include "xlcfeatures.h"
#elif defined(__PGI)
#include "pgccfeatures.h"

In our case this actually sidesteps the first issue, but that appears to just be by accident. Is is less clear if this is really a bug, but it appears to be unintentional behaviour.

(See BlueBrain/CoreNeuron#724 for more information.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildbuild system and portability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions