Hello,
My code works fine without offloading to GPU. When I select the option "Enable OpenMP offloading" in "Code Generation" in "Fortran" of project properties I get two errors:
1. Error Device name missing
2. Error#10401 error running 'offline compiler'
I m attaching screenshots of the errors and the options I selected in code generation.
I installed the latest version available on intel website of ifx (one api toolkit and HPC).
This is my processor: Intel® Core™ i9-11950H Processor
Thank you for your help.
You do need special drivers to allows offload to the GPU. The factory drivers are for graphics only, not compute.
I will say that Intel does not document the prerequisites well.
First, there is the oneAPI Installation Guide
On the Installation Guide page, there is a link to Prerequisites
This page is not so good, but near the bottom is a key link
Set Up Your System for Intel GPU
If you are using Intel GPU, you need to install the GPU drivers separately.
And on this page is FINALLY a link to your GPU
That driver is necessary for offload to Intel GPUs from our ifx openmp implementation.
連結已複製
One more thing... If you use DO CONCURRENT, that compute can be offloaded to an Intel GPU without changing your code. Compile with the option -fopenmp-target-do-concurrent (Linux) or /Qopenmp-target-do-concurrent (Windows).
See the Intel Fortran Developer Guide and Reference for more info.
There is this page with some helpful examples. That might be a starting point. There are references on the bottom of this page to books and tutorials in OpenMP.
But looking at your output, I have questions:
1) did you install the correct Device Driver for you GPU? What GPU are you targeting, that is, what CPU and GPU do you have?
2) Intel Fortran installation:
- What version of Intel Fortran are you using?
- Did you install the Intel oneAPI Base Toolkit or HPC Toolkit, or simply the Fortran compiler by itself from the Component Downloads page?
Thank you for your reply and for the link with the valuable resources.
I bought my computer with the CPU Intel® Core™ i9-11950H Processor (Intel® Core™ i9-11950H Processor). It should have integrated GPU (Intel® UHD Graphics for 11th Gen Intel® Processors). I m assuming the intel offload to this GPU should work because it is made by intel.
My computer also has NVIDIA RTX A5500 GPU but from what I read, it would not work with intel GPU offload.
I m using the computer as bought so I m assuming all the drivers are installed properly.
I believe that I installed the Intel oneAPI Base Toolkit with intel ifx fortran compiler. The version is: Intel(R) 64, Version 2024.0.2 Build 20231213.
So far I was not able to run any simple example of offload to GPU.
You do need special drivers to allows offload to the GPU. The factory drivers are for graphics only, not compute.
I will say that Intel does not document the prerequisites well.
First, there is the oneAPI Installation Guide
On the Installation Guide page, there is a link to Prerequisites
This page is not so good, but near the bottom is a key link
Set Up Your System for Intel GPU
If you are using Intel GPU, you need to install the GPU drivers separately.
And on this page is FINALLY a link to your GPU
That driver is necessary for offload to Intel GPUs from our ifx openmp implementation.
Are these drivers only available for Windows, like the link indicates? How would I proceed in Linux?
For Linux, please see Installation Guide for Linux
Specifically, 'Install Intel GPU Drivers'
@Alexandre1999 wrote:
Are these drivers only available for Windows, like the link indicates? How would I proceed in Linux?
If you set environment variable LIBOMPTARGET_PLUGIN_PROFILE=T
That can be done in Visual Studio or from the command line.
This will print out each offload kernel that executed and how much time was taken, along with the amount of data transferred. If you get that report it did indeed offload. If not, it did not.
Thank you. I got the report above for the matrix multiplication example. It says thread 0, omp device (0). This is offload and run in parallel threads the code below?
!$omp target map(to: a, b ) map(tofrom: c )
!$omp parallel do private(j,i,k)
do j=1,n
do i=1,n
do k=1,n
c(i,j) = c(i,j) + a(i,k) * b(k,j)
enddo
enddo
enddo
!$omp end parallel do
!$omp end target
I set the environment variable in the command line as follows: " set LIBOMPTARGET_PLUGIN_PROFILE=T " and it worked.
I tried to set it with visual studio but it did not work:
I also tried the following and it still did not work:
