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

How to enable the GPU to run a FORTRAN program?

eliopoulos
新手
11,561 檢視

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 積分
49 回應
eliopoulos
新手
3,975 檢視

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

Barbara_P_Intel
3,954 檢視

>>  Only Intel GPU are compatible with FORTRAN?

Yes. Intel Fortran only works with Intel GPU.

 

 

eliopoulos
新手
3,942 檢視

Can I do anything about the environment issue?

Barbara_P_Intel
3,871 檢視

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

 

eliopoulos
新手
3,864 檢視
eliopoulos
新手
3,852 檢視

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"

Steve_Lionel
榮譽貢獻者 III
3,833 檢視

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
新手
3,823 檢視

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

Barbara_P_Intel
3,767 檢視

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.

 

 

eliopoulos
新手
3,761 檢視

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

Barbara_P_Intel
3,719 檢視

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.

eliopoulos
新手
3,697 檢視

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.

eliopoulos
新手
3,683 檢視

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

Barbara_P_Intel
3,671 檢視

@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.

 

eliopoulos
新手
3,662 檢視

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

Barbara_P_Intel
3,636 檢視

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?

 

eliopoulos
新手
3,607 檢視

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.

joshbuttler1
初學者
3,590 檢視

I think your problem has been solved?  Right?

eliopoulos
新手
3,573 檢視

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

Barbara_P_Intel
3,554 檢視

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

 

eliopoulos
新手
3,541 檢視
回覆