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

How to enable the GPU to run a FORTRAN program?

eliopoulos
Novice
5,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
eliopoulos
Novice
1,976 Views

When I run the program from the Visual Studio is the same.

0 Kudos
Barbara_P_Intel
Employee
1,955 Views

>>  Only Intel GPU are compatible with FORTRAN?

Yes. Intel Fortran only works with Intel GPU.

 

 

0 Kudos
eliopoulos
Novice
1,943 Views

Can I do anything about the environment issue?

0 Kudos
Barbara_P_Intel
Employee
1,872 Views

What does your PATH variable look like? Perhaps the wrong directory is being picked up by ifx.

 

0 Kudos
eliopoulos
Novice
1,865 Views
0 Kudos
eliopoulos
Novice
1,853 Views

I don't know if this is what you want but I have:

Executables: $(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\bin\HostX64\x64;$(UniversalCRTSdkDir)bin\$(UCRTVersion)\x64;$(UniversalCRTSdkDir)bin\x64;$(IFortInstallDir)bin;$(IFortInstallDir)bin;$(VSInstallDir)Common7\ide;$(VSInstallDir)Common7\Tools;$(FrameworkDir)$(FrameworkVersion);$(WindowsSdkDir)bin\x64;$(PATH)

Includes: $(UniversalCRTSdkDir)Include\$(UCRTVersion)\um;$(UniversalCRTSdkDir)Include\$(UCRTVersion)\shared;$(IFortInstallDir)opt\compiler\include;$(MKLInstallDir)..\latest\include;$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\include;$(WindowsSdkDir)include\um;$(WindowsSdkDir)include\shared;$(FrameworkSDKDir)include

Libraries: $(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\lib\x64;$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\um\x64;$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x64;$(IFortInstallDir)lib;$(MKLInstallDir)..\latest\lib;$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\lib\x64;$(WindowsSdkDir)lib\winv6.3\um\x64

Default options: /Qlocation,link,"$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\bin\HostX64\x64"

0 Kudos
Steve_Lionel
Honored Contributor III
1,834 Views

To see what PATH is from a command window, type:

 

set path > path.txt

and then attach path.txt to a reply here. Note that the path in a Fortran command prompt window (started with the Intel shortcut) is different from the system PATH which is what will be used if you double-click on an EXE, so check PATH from a bare command prompt (Click Start, type "cmd" (no quotes) and then open Command Prompt when it appears.) The Visual Studio environment is different still.

eliopoulos
Novice
1,824 Views

Because I didn't understand which one is needed, I am providing both paths, From Fortran cmd (path1) and from cmd (path2).

0 Kudos
Barbara_P_Intel
Employee
1,768 Views

It looks like path1.txt is the PATH from the oneAPI command window. That's the command window you want to use. The PATH is like what is on my laptop. I asked to be sure some other directories were not before the ones for oneAPI components.

What version of VS is installed?

Please post a reproducer.

 

 

0 Kudos
eliopoulos
Novice
1,762 Views

Visual Studio 2022 Enterprise is installed. I didn't understand the reproducer thing. What exactly should I do?

0 Kudos
Barbara_P_Intel
Employee
1,720 Views

Can you please be more specific about the version of VS 2022 you are using? To get that, start VS, open a solution, click Help in the top bar, click about Microsoft Visual Studio. In the upper left corner there's a version number. It may be something like Version 17.8.1.

A reproducer is a small sample program that demonstrates the issue.

0 Kudos
eliopoulos
Novice
1,698 Views

The VS 2022 version is 17.8.6. I haven't got a suitable reproducer. When I run the reproducer I have, I get different errors.

0 Kudos
eliopoulos
Novice
1,684 Views

An update:

when I build the solution, I get:

Rebuild started at 17:18...
1>------ Rebuild All started: Project: BSFADAS_03 (IFX), Configuration: Release x64 ------
Deleting intermediate files and output files for project 'BSFADAS_03', configuration 'Release|x64'.
Compiling with Intel® Fortran Compiler 2024.0.2 [Intel(R) 64]...
BSFADAS_03.for
ifx: warning #10148: option '/size-llp64' not supported
ifx: warning #10148: option '/size-llp64' not supported
Linking...
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.0.2 Build 20231213
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.
12744354.o : warning LNK4078: multiple '__CLANG_OFFLOAD_BUNDLE__openmp-s' sections found with different attributes (40500040)
Embedding manifest...

Build log written to "file://C:/Work/Work/2023%20OPENZDM/Fortran%20folder/BSFADAS_03/x64/Release/BuildLog.htm"
BSFADAS_03 - 0 error(s), 3 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Rebuild completed at 17:18 and took 31.941 seconds ==========

and when I run the program:

LEVEL_ZERO message: Error: module creation failed
LEVEL_ZERO message: Target build log:
LEVEL_ZERO message: <empty>
Libomptarget error: Unable to generate entries table for device id 0.
Libomptarget error: Failed to init globals on device 0
Libomptarget error: Run with
Libomptarget error: LIBOMPTARGET_DEBUG=1 to display basic debug information.
Libomptarget error: LIBOMPTARGET_DEBUG=2 to display calls to the compute runtime.
Libomptarget error: LIBOMPTARGET_INFO=4 to dump host-target pointer mappings.
Libomptarget error: Source location information not present. Compile with -g or -gline-tables-only.
Libomptarget fatal error 1: failure of target construct while offloading is mandatory

0 Kudos
Barbara_P_Intel
Employee
1,672 Views

@eliopoulos, earlier you wrote that you couldn't run the samples I pointed you to successfully. Can you please attach one that fails? Then I can be sure what you are running and work with that.

 

0 Kudos
eliopoulos
Novice
1,663 Views

This sample fails for a large number n but works for smaller values.

0 Kudos
Barbara_P_Intel
Employee
1,637 Views

Thanks for the file. 

I ran into the same issue on my laptop... not enough memory in the Intel(R) Iris(R) Xe Graphics GPU for the larger arrays.

So your software environment seems fine then. Good!

'/size-llp64' is not an ifx compiler option. Can you attach the BuildLog.htm? Where did you get that compiler option?

 

0 Kudos
eliopoulos
Novice
1,608 Views

I am not allowed to attach the file. Here it is:

Build Log
  

Build started: Project: BSFADAS_03, Configuration: Release|x64

Output
  
Deleting intermediate files and output files for project 'BSFADAS_03', configuration 'Release|x64'.
Compiling with Intel® Fortran Compiler 2024.0.2 [Intel(R) 64]...
ifx /nologo /O2 /Qopenmp-targets:spir64 /Qopenmp /Qiopenmp /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc170.pdb" /libs:dll /threads /c /Qmkl /integer-size:64 /Qlocation,link,"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64" /Qm64 "C:\Work\Work\2023 OPENZDM\Fortran folder\BSFADAS_03\BSFADAS_03.for"
ifx: warning #10148: option '/size-llp64' not supported
ifx: warning #10148: option '/size-llp64' not supported

Linking...
Link /Qiopenmp /Qopenmp-targets:spir64 /Fe"x64\Release\BSFADAS_03.exe"  "x64\Release\BSFADAS_03.obj" /link /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"libcmt.lib" /MANIFEST /MANIFESTFILE:"x64\Release\BSFADAS_03.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Work\Work\2023 OPENZDM\Fortran folder\BSFADAS_03\x64\Release\BSFADAS_03.lib"
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.0.2 Build 20231213
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.

7764354.o : warning LNK4078: multiple '__CLANG_OFFLOAD_BUNDLE__openmp-s' sections found with different attributes (40500040)

Embedding manifest...
mt.exe /nologo /outputresource:"C:\Work\Work\2023 OPENZDM\Fortran folder\BSFADAS_03\x64\Release\BSFADAS_03.exe;#1" /manifest "x64\Release\BSFADAS_03.exe.intermediate.manifest"

BSFADAS_03 - 0 error(s), 3 warning(s)

I don't know where I got that option.

0 Kudos
joshbuttler1
Beginner
1,591 Views

I think your problem has been solved?  Right?

0 Kudos
eliopoulos
Novice
1,574 Views

No, it has not been solved yet, I think.

0 Kudos
Barbara_P_Intel
Employee
1,555 Views

Thank you. You only need one of these: /Qopenmp /Qiopenmp. I recommend using /Qiopenmp.

 

0 Kudos
eliopoulos
Novice
1,542 Views
0 Kudos
Reply