Issue when using PGI unified memory

Hi,

I am seeing the following error. There seems to be something wrong outside my code as I am using “-ta=tesla:managed”. Also, the code works on other machines in this context.


Current file: /home/webber/cs_development/cs-revise-build5-managed/code_saturne-4.0.2/src/alge/cs_matrix.c
function: _mat_vec_p_l_csr
line: 2237
Current region was compiled for:
NVIDIA Tesla GPU sm30 sm35 sm30 sm35 sm50
Available accelerators:
device[1]: Native X86 (CURRENT DEVICE)
The accelerator does not match the profile for which this program was compiled
solver script exited with status 1.

Error running the calculation.

Check Code_Saturne log (listing) and error* files for details.

best,

Jackie

Hi Jackie,

Does the code workout CUDA Unified Memory? (i.e. just -ta=tesla).

The error indicates that you don’t have a NVIDIA GPU available on this system, or at least the CUDA driver isn’t installed.

Can you please run utility “pgaccelinfo” and/or “nvidia-smi”? These will show what devices you have installed.

  • Mat

Hi Mat,

I test an Conjugate Gradient example from nvidia which use CUDA Unified Memory(use Openacc) and it’s run well.
after II run nvidia-smi command, it show the machine have two nvidia GPUs.

I think it could be the revise open resouces software problem. I want to know if I change realloc functions to malloc functions, I will use CUDA Unified Memory. Therefore, how should I modify the code? Is there any example of revised exams here?

I want to know if I change realloc functions to malloc functions, I will use CUDA Unified Memory. Therefore, how should I modify the code?

A realloc can be rewritten like:

  • if the new size is smaller than the old, do nothing. Otherwise,

  • Malloc a temp pointer to the new size.

  • use memcpy to copy the contents of the old array to the temp array

  • free the old array

  • set the original pointer to the temp

  • Mat