Compiler failed to translate accelerator region

Hello,
I’m trying to accelerate a combustion fluid dynamics code using CUDA. But to do so I need to execute a differential equation solver in the GPU. I have defined all the necessary functions and subroutines as device in the solver code but I get the error:

Compiler failed to translate accelerator region (see -Minfo messages): Unsupported procedure

You could find the archive in Dropbox - Error - Simplify your life

Many thanks

Hi ElMaskina,

The “Unsupported feature” is an allocate and deallocate. Typicially, you don’t want these in device code.

We id did recently add support for allocate/deallocate in device code (PGI 13.3 or later) but you have to have a Kepler K20 card, and compile with “-Mcuda=rdc,cc35”. Though, great thought and care needs to be done before doing this since haveing many thousands of threads all allocating memory, may have a severe performance impact and/or cause you to run out of memory.

  • Mat
% pgf90 -acc -c LIB_dvode_f90_d.f90 -Minfo=accel -Mcuda -V13.6
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 4947)
  0 inform,   0 warnings,   1 severes, 0 fatal for set_opts
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 5759)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvode_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9288)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvpreps
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9606)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvrenew
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9907)
  0 inform,   0 warnings,   1 severes, 0 fatal for bgroup_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 10119)
  0 inform,   0 warnings,   1 severes, 0 fatal for banded_iaja_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 10921)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvjacs28

Hello,
I commented all the calls to allocate() and allocated() in the program, with these changes the CPU version works fine, so that is not needed for my program. But when I try to compile it with the GPU, new errors appear.

/tmp/pgcudaforsjGd2IIOIOhN.gpu(6): error: expected an expression



/tmp/pgcudaforsjGd2IIOIOhN.gpu(1234): error: identifier “_dvode_f90_m_d_4” is undefined

Here is the new version Dropbox - Error - Simplify your life

Hi ElMaskina,

The first error “expected an expression” is actually due to a know compiler issue (TPR#19370) when using multiple data statements in a device module. The work around is to not use DATA statements with device variables as well as the data initialization of “MORD”.

The second error is because you’re trying to access host data from within device code. Typically the compiler finds these cases but we’re missing it here. Specifically, you for forgot to add “device” to the module allocatable arrays at line 1990 (starts with the array BIGP). After these changes the code will compile.

  • Mat

So, how can I initialize the data?

So, how can I initialize the data?

At run time.

MP=6
NLP=6
.etc.