nvvmCompileProgram Error: 9 in debug mode.

Hello.

My code compiles in release mode, but not in debug mode.

Following is the error message.

nvvmCompileProgram error: 9.
Error: C:\Users\USER\AppData\Local\Temp\pgacc2awaPdcSMtgeu7.gpu (195, 146): parse use of undefined metadata ‘!8895134’
pgnvd-Fatal-Could not spawn C:\Program Files\PGI\win64\15.10\bin\pgnvvm.exe

And following is the code section where problem occurs.

#include <CUDADEFINES.h>

MODULE CUDACONST

IMPLICIT NONE

INTEGER, CONSTANT :: nfsr, nxy, nz, nzf, ng, nofg, norg, nchi
INTEGER, CONSTANT :: nRotRay, nModRay, nAziAngle, nPolarAngle, nPhiAngSv, nMoment, ScatOd
INTEGER, CONSTANT :: InScatRange(2, GPU_MAX_GROUP), AziMap(GPU_MAX_AZI, 2), dir(2, 2), inc(2)
REAL(GPU_PRECISION), CONSTANT :: rsinv(GPU_MAX_POLAR), sinv(GPU_MAX_POLAR)
REAL(GPU_PRECISION), CONSTANT :: wt(GPU_MAX_POLAR, GPU_MAX_AZI), wt1D(GPU_MAX_POLAR)
REAL(GPU_PRECISION), CONSTANT :: wtsurf(4, GPU_MAX_POLAR, GPU_MAX_AZI), wtsurf1D(GPU_MAX_POLAR)
REAL(GPU_PRECISION), CONSTANT :: Comp(GPU_MAX_ORDER, GPU_MAX_POLAR, GPU_MAX_AZI)
REAL(GPU_PRECISION), CONSTANT :: mwt(GPU_MAX_ORDER, GPU_MAX_POLAR, GPU_MAX_AZI)

END MODULE

MODULE CUDAMOD

USE CUDATypeDef,	ONLY : cuMOC_Type,			cuCMFD_Type,		cuDevice_Type,		cuWorkset_Type,				&
						   cuRotRay_Type,		cuDcmpRay_Type,		cuXsData_Type,		cuFxr_Type,					&
						   cuIsotope_Type,		cuAxial_Type
USE CUDAFOR
USE CUSPARSE
USE CUBLAS
IMPLICIT NONE

TYPE(cuMOC_Type), POINTER :: cuMOC(:)
TYPE(cuCMFD_Type), POINTER :: cuCMFD(:)
TYPE(cuDevice_Type), POINTER :: cuDevice(:)
TYPE(cuWorkset_Type), POINTER :: hostWorkset(:, :)
TYPE(cudaEvent) :: startEvent, stopEvent

TYPE(cusparseHandle), POINTER :: sparseHandle(:)
TYPE(cublasHandle), POINTER :: blasHandle(:)
INTEGER(KIND = cuda_stream_kind), POINTER :: cuStream(:)

TYPE(cuRotRay_Type), POINTER :: cuFastRay(:, :), cuCellRay(:)
TYPE(cuDcmpRay_Type), POINTER :: cuDcmpRay(:)

TYPE(cuFxr_Type), POINTER :: cuFxr(:)
TYPE(cuIsotope_Type), POINTER :: cuIsotope(:, :)
TYPE(cuXsData_Type), POINTER :: cuXsData(:)

TYPE(cuAxial_Type), POINTER :: cuAxial(:)
INTEGER, ALLOCATABLE :: AxType(:), AxTypeGroup(:, :), AxTypeInterface(:, :)
INTEGER :: nAxType, nInterface

!--- CUDA Unified Memory for Domain Connected Pn Ray Tracing
REAL(GPU_PRECISION), ALLOCATABLE, MANAGED :: __phim(:, :, :)
!-----------------------------------------------------------

REAL :: loadFactor(2, 2, 2), executionTime(2, 2, 2)
INTEGER(8) :: totalWorkload

INTERFACE

SUBROUTINE BaseCellRaySort(Core, RayInfo, BCRSort)
USE PARAM
USE TYPEDEF,		ONLY : CoreInfo_Type,		RayInfo_Type
USE CUDATypeDef,	ONLY : cuBCR_Type
IMPLICIT NONE

TYPE(CoreInfo_Type) :: Core
TYPE(RayInfo_Type) :: RayInfo
TYPE(cuBCR_Type), POINTER :: BCRSort(:)
END SUBROUTINE

SUBROUTINE AssignGPUPlane(cuDevice)
USE PARAM
USE CUDATypeDef,	ONLY : cuDevice_Type
IMPLICIT NONE

TYPE(cuDevice_Type), POINTER :: cuDevice(:)
END SUBROUTINE

SUBROUTINE SetControlVar(Core, RayInfo, cuDevice)
USE PARAM
USE TYPEDEF,		ONLY : CoreInfo_Type,		RayInfo_Type
USE CUDATypeDef,	ONLY : cuDevice_Type
IMPLICIT NONE

TYPE(CoreInfo_Type) :: Core
TYPE(RayInfo_Type) :: RayInfo
TYPE(cuDevice_Type), POINTER :: cuDevice(:)
END SUBROUTINE

SUBROUTINE CopyRayVar(Core, RayInfo, BCRSort, cuDevice)
USE PARAM
USE TYPEDEF,		ONLY : CoreInfo_Type,		RayInfo_Type
USE CUDATypeDef,	ONLY : cuBCR_Type,		cuDevice_Type
IMPLICIT NONE

TYPE(CoreInfo_Type) :: Core
TYPE(RayInfo_Type) :: RayInfo
TYPE(cuBCR_Type), POINTER :: BCRSort(:)
TYPE(cuDevice_Type) :: cuDevice
END SUBROUTINE

SUBROUTINE CUDALoadRebalance(RayInfo, InIter, iSweep, loadFactor, executionTime)
USE PARAM
USE TYPEDEF,		ONLY : RayInfo_Type
IMPLICIT NONE

TYPE(RayInfo_Type) :: RayInfo
INTEGER :: InIter, iSweep
REAL :: loadFactor(2, 2, 2)
REAL, OPTIONAL :: executionTime(2, 2, 2)
END SUBROUTINE

END INTERFACE

END MODULE

Having two modules in one source file is problematic?

Hi CNJ,

Having two modules in one source file is problematic?

No. I think you’re just entering a compiler issue when using “-g”. Can you please send a reproducing example to PGI Customer Service (trs@pgroup.com) so we can investigate?

Thanks,
Mat

If I remove

!--- CUDA Unified Memory for Domain Connected Pn Ray Tracing 
 REAL(GPU_PRECISION), ALLOCATABLE, MANAGED :: __phim(:, :, :) 
 !-----------------------------------------------------------

the problem vanishes.

But if I leave only that, the code also compiles without error.

I don’t see any similar issues in any previously reported problem reports. You can try updating to a later compiler to see if this has been fixed, but it would still be helpful to send PGI Customer Service a reproducing example so we can investigate.

Thanks,
Mat