run on K40

We have a HPE server equipped with two NVIDIA K40 accelerators used for parallelization with OpenACC and FORTRAN.
The compilation is done successfully: pgfortran -Minfo = accel -ta = nvidia vecadd.f90 -o test.out
While during the execution I have this error message:
./test.out
Current file: /home/admin/intissar/vecadd.f90
function: main
line: 28
Current region was compiled for:
NVIDIA Tesla GPU sm30 sm35 sm30 sm35 sm50
Available accelerators:
device[1]: Native X86
The accelerator does not match the profile for which this program was compiled

Can you help me ?

What’s the output of deviceQuery from the cuda demos (/opt/cuda/extras/demo_suite/deviceQuery or where you installed it)?

i can’t found CUDA

Should be installed, otherwise I wouldn’t know how you suceeded compiling your program.
Please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post will reveal a paperclip icon.

Sorry,
How can I attach the report ?

Hovering the mouse over an existing post will reveal a paperclip icon.

I just attached the report
nvidia-bug-report.log.gz (96.7 KB)

You are running a 384.111 nvidia driver on a RHEL 7.5 system. So the maximum cuda version should be 9.0.
If you installed it via rpm, it should reside in /usr/local, there should be a directory cuda-9.0, please check.
In directory cuda-9.0, there’s a directory samples/1_Utilities which should contain deviceQuery. If so, please run that and post the output.

Thanks for your help
there are many directories contain deviceQuery, which one should I run it ?

Use that from the CUDA-Fortran/SDK/deviceQuery directory. You’ll have to run ‘make’ there first to compile the binary.

[root@srv-app ~]# cd /opt/pgi/linux86-64/2017/examples/CUDA-Fortran/SDK/deviceQuery/
[root@srv-app deviceQuery]# make
pgfortran -fast -o deviceQuery.out deviceQuery.cuf
make: pgfortran : commande introuvable
make: *** [build] Erreur 127

Run it as normal user, not root.

[admin@srv-app deviceQuery]$ make
pgfortran -fast -o deviceQuery.out deviceQuery.cuf
/usr/bin/ld : ne peut ouvrir le fichier de sortie deviceQuery.out : Permission non accordée
pgacclnk: child process exit status 1: /usr/bin/ld
make: *** [build] Erreur 2

Adjust the directory permissions, delete deviceQuery.out which might have been generated previously when you ran as root.

The .out file does not exist
[admin@srv-app deviceQuery]$ ls -a -l
total 16
drwxrwxr-x. 2 root root 43 30 oct. 2017 .
drwxrwxr-x. 11 root root 4096 30 oct. 2017 …
-r–r–r–. 1 root root 5056 30 oct. 2017 deviceQuery.cuf
-r–r–r–. 1 root root 974 30 oct. 2017 Makefile

copy both files to a directory where your user has write permission, then run make again.

[admin@srv-app ~]$ make
pgfortran -fast -o deviceQuery.out deviceQuery.cuf
./deviceQuery.out
cudaGetDeviceCount failed – CUDA driver and runtime may be mismatched
FORTRAN STOP

Did you install CUDA at all? If not, please do so.
[url]https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=RHEL&target_version=7&target_type=rpmlocal[/url]
Version 9.2 requires using a newer driver.

Here cuda 9.0 can be acquired which matches your 384 driver:
[url]https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=RHEL&target_version=7&target_type=rpmlocal[/url]

Both are installed
[admin@srv-app ~]$ sudo rpm -i cuda-repo-rhel7-9-2-local-9.2.88-1.x86_64.rpm
attention : cuda-repo-rhel7-9-2-local-9.2.88-1.x86_64.rpm: Entête V3 RSA/SHA512 Signature, clé ID 7fa2af80: NOKEY
paquet cuda-repo-rhel7-9-2-local-9.2.88-1.x86_64 déjà installé

[admin@srv-app ~]$ sudo rpm -i cuda-repo-rhel7-9-0-local-9.0.176-1.x86_64.rpm
[sudo] Mot de passe de admin : 
attention : cuda-repo-rhel7-9-0-local-9.0.176-1.x86_64.rpm: Entête V3 RSA/SHA512 Signature, clé ID 7fa2af80: NOKEY
paquet cuda-repo-rhel7-9-0-local-9.0.176-1.x86_64 déjà installé