I am using PGI Fortran compiler 12.1 on windows 7, I have a code that compile perfectly with PGI, I want to move some of the subroutines to GPU, unfortunately, when I created a module called GReynVar_mod, I have the following error when I compile:
Error 1 Unable to open MODULE file greynvar_mod.mod D:\Cuda Dev\Quick_cuda\reynolds.f90 354
in file reynolds.f90, line 354:
use GReynVar_mod
by the way, the original code have few modules that have no problems to compile before I created the module.
The error simply means that the dependent module file can’t be found. Some possible reasons why are:
The file that file that contains the module hasn’t been compiled yet.
If you are using PVF, then this message is not unusual especially if it’s the first time the project is compiled. PVF will make multiple compilation passes building up a dependency list. If your dependencies change, then you may need to first clean the project before rebuilding.
If you are using makefiles, you need to add the GReynVar_mod.obj to reynolds.f90 dependencies.
If you are building by hand, you need to compile the GReynVar_mod file before compiling reynolds.f90
You built the GReynVar_mod module in a different directory.
The default is to look in the same directory as the source for any dependent files. If the module file is in a different directory, you can tell the compiler search this directory by using the “-I” or “-module ” flags.
why I have to move the module related to GPU to common.f90?
is there something I missed?
I don’t know for sure how your project is organized, but if your module’s source file is not part of your project, then the rest of your program wont be able to find the generated module file.
why some of the variables like iqpo cannot be used in a global module?
These errors mean that you are trying to use a variable who’s data storage resides in host memory within code that is running on the GPU. The GPU can not directly access host memory.
so, I did copy all the variables from host memory to a designated device memory, passed them to the GPU subroutine, and there is no errors from that kind anymore, but, when I try to compile, it compiles but, at the end it gives me the following error and exit:
D:\Cuda Dev\Quick_cuda\common.f90(602) : error F0000 : Internal compiler error. Device compiler exited with error status code 0
PGF90/x86-64 Windows 12.3-0: compilation aborted
by the way, line 602 is the end of the do loop I used to control the threads being executed.
here is the beginning of the subroutine:
Are there any messages above the this one? This is just a generic error stating that the backend NVIDIA tools failed for some reason. There should additional messages above this as to why it failed.
Looks like the compiler is generating bad GPU code. Can you send a reproducing example to PGI Customer Support (trs@pgroup.com) so we can determine what’s wrong?
We need enough of the source code that we can reproduce the error here. If you want, you can send us the all source files but some users prefer to send only a minimal amount of source.
The problem is that you are using several host arrays (see below) from within device code. This is illegal since only device arrays may be accessed within device code. The compiler should be giving you a syntax error but isn’t for some reason. I’ve add TPR#18741 asking our engineers to investigate. To fix your code, you need to allocate device arrays and then copy the host values to the device.