Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28330 Discussions

How to enable the GPU to run a FORTRAN program?

eliopoulos
Novice
2,881 Views

How can I enable the GPU to run a parallel do loop in a FORTRAN program? I have tried: "!$omp target teams distribute parallel do" but the GPU does not run. Any advice?

0 Kudos
49 Replies
Barbara_P_Intel
Moderator
1,672 Views

Which Fortran compiler are you using?

How are you compiling? 

Have you seen this article?

Here's a tutorial

 

 

0 Kudos
eliopoulos
Novice
1,664 Views

Thank you. I have installed Intel oneapi 2021 base and HPC toolkit. I have compiled using: Generate Parallel Code (/Qopenmp). I shall read the article and the tutorial.

0 Kudos
Barbara_P_Intel
Moderator
1,660 Views

I suggest you install the oneAPI 2024 release of Base and HPC Toolkits. Those were released in November 2023 with new features and bug fixes.

 

0 Kudos
eliopoulos
Novice
1,655 Views

I have a problem with that. I cannot uninstall the current version. I press uninstall and then remove and it does nothing.

0 Kudos
Devorah_H_Intel
Moderator
1,551 Views

@eliopoulos wrote:

I have a problem with that. I cannot uninstall the current version. I press uninstall and then remove and it does nothing.


Please report the details of uninstallation and installation issue in this forum https://community.intel.com/t5/oneAPI-Registration-Download/bd-p/registration-download-licensing-instal 

0 Kudos
Barbara_P_Intel
Moderator
1,550 Views

Here's another article on using OpenMP directives to offload to Intel GPUs.

0 Kudos
eliopoulos
Novice
1,487 Views

I get the warning: '/Qopenmp-targets:spir64' not supported. Is it the Intel oneapi version I use or something else?

0 Kudos
Barbara_P_Intel
Moderator
1,454 Views

Can you please post your link command?

0 Kudos
eliopoulos
Novice
1,450 Views

I don't link by command. I just write in the command line: /Qxhost /Qopenmp /Qopenmp-targets:spir64 and I build the solution.

0 Kudos
Barbara_P_Intel
Moderator
1,446 Views

Are you using ifx? GPUs are not supported with ifort.

 

 

0 Kudos
eliopoulos
Novice
1,440 Views
0 Kudos
eliopoulos
Novice
1,402 Views

Ok, I used ifx and I get:

Severity Code Description Project File Line Suppression State
Error error LNK2019: unresolved external symbol __tgt_target_teams_mapper referenced in function MAIN__ BSFADAS_03.obj
Error error LNK2019: unresolved external symbol __tgt_push_code_location referenced in function MAIN__ BSFADAS_03.obj
Error fatal error LNK1120: 2 unresolved externals x64\Release\BSFADAS_03.exe

0 Kudos
eliopoulos
Novice
1,375 Views

When I link using the command: 

ifx /Qxhost /Qopenmp /Qopenmp-targets:spir64 /Qmkl bsfadas_03.for

I get:

1882084.obj : warning LNK4078: multiple '__CLANG_OFFLOAD_BUNDLE__openmp-s' sections found with different attributes (40100800)

1882084.obj : warning LNK4078: multiple '__CLANG_OFFLOAD_BUNDLE_SIZE__ope' sections found with different attributes (40100800)

 

and when I run the program:

Libomptarget error: Unable to generate entries table for device id 0.
Libomptarget error: Failed to init globals on device 0
Libomptarget error: Failed to get device 0 ready
Libomptarget error: run with env LIBOMPTARGET_INFO>1 to dump host-target pointer maps
Libomptarget error: Build with debug information to provide more informationLibomptarget fatal error 1: failure of target construct while offloading is mandatory

0 Kudos
Barbara_P_Intel
Moderator
1,366 Views

Have you been able to run a code that doesn't use MKL successfully? I'm just trying to keep this simple to start.

 

0 Kudos
eliopoulos
Novice
1,361 Views

I have tried a simple code I found in one of your articles and produces the same warnings. The program runs but the GPU is not enabled.

0 Kudos
Barbara_P_Intel
Moderator
1,352 Views

Yes, you need a GPU driver installed. I don't use the GPU in my laptop. But, be aware, most of the Intel GPUs on laptops only support 32 reals. 

For Windows here's a link to Intel GPU drivers. And another one for older Intel GPUs.

Are you aware of the Intel Developer Cloud? You can get free access to Intel CPU/GPU on Linux.

 

 

0 Kudos
eliopoulos
Novice
1,348 Views

I have already installed the latest driver (version 31.0.101.5186) of my Intel iris xe graphics GPU.

0 Kudos
eliopoulos
Novice
1,196 Views

I have uninstalled the previous versions and installed Visual Studio 2022 Enterprise and Intel oneapi 2024 base and HPC toolkit but nothing changed. Only Intel GPU are compatible with FORTRAN?

0 Kudos
Barbara_P_Intel
Moderator
1,196 Views

What version of Windows are you using? Are you running from VS or Command window? Can you try the other?

This seems like an environment issue. I don't have access to Iris xe graphics on Windows to test.

 

0 Kudos
eliopoulos
Novice
1,177 Views

I use Windows 11 Pro. I run from the Command window. I shall try the other.

0 Kudos
Reply