1

Using the GCC compiler and OpenMP programming, I’m now working on a project that offloads data to an Nvidia GPU. I needed some help in figuring out an issue . The default setup uses a virtual GPU that emulates the Kepler architecture (compute capability 3.1) rather than the real GPU being utilised (Maxwell architecture, compute capability 5.3), which results in lower GPU utilisation. The production of the assembly code includes ways for overriding the default GCC configuration using “-march” and the PTX ISA version, “-mptx,” but none of these really change the setting, as can be seen from the generated assembly code. Does altering the default configuration in building GCC need any special GCC build configuration? Or anything else except this that I ought to be doing. If any of you have worked in a similar setting, please do let me know.

I am getting this in the preamble of the generated assembly code .version 6.0 .target sm_30 .address_space 63

whereas i require .target to sm_53

Charu Jain
  • 36
  • 6

1 Answers1

0

Invoking offloading compilation (which for GCC happens at link time) with -foffload-options=nvptx-none=-march=sm_53 should get you what you desire -- at least for your user code.

If you also need any potential GCC/nvptx runtime libraries built for sm_53, indeed that is a GCC build-time configuration; see https://gcc.gnu.org/install/specific.html#nvptx-x-none:

The --with-arch option may be specified to override the default value for the -march option, and to also build corresponding target libraries. The default is --with-arch=sm_30.

For example, if --with-arch=sm_70 is specified, -march=sm_30 and -march=sm_70 target libraries are built, and code generation defaults to -march=sm_70.

(Maybe you don't actually need the latter, depending on what exactly you're doing.)

tschwinge
  • 346
  • 1
  • 5