Error compiling PAPI with intel_gpu

144 views
Skip to first unread message

Jordi Alcaraz

unread,
Nov 30, 2022, 5:30:38 PM11/30/22
to ptools-perfapi
I'm trying to install PAPI with the component "intel_gpu" but I'm unable to, the followinf error appears:
g++ -g -fpic -g -diag-disable 188,869,271  -DPAPI_NUM_COMP=4  -g -DDEBUG  -Icomponents/intel_gpu/internal -Icomponents/intel_gpu/internal/inc -D_GLIBCXX_USE_CXX11_ABI=1 -I/hsa/include -I/hsa/include/hsa -I/rocm_smi/include -I/rocm_smi/include/rocm_smi -I/include  -Icomponents/intel_gpu/internal/inc -I/usr/include/level_zero/ -o GPUMetricInterface.o -c components/intel_gpu/internal/src/GPUMetricInterface.cpp
g++: error: 188,869,271: No such file or directory

In the attached files you can check the outputs of configure and make

My steps to configure and compile PAPI are:
  • source /opt/intel/oneapi/setvars.sh
  • export INTEL_L0_HEADERS=/usr/include/level_zero/
  • cd papi-7.0.0/src
  • make clean
  • ./configure --with-components="intel_gpu"
  • make

    What could be the problem?
configure.out
make.out

Servat, Harald

unread,
Nov 30, 2022, 5:56:22 PM11/30/22
to Jordi Alcaraz, ptools-perfapi, Servat, Harald

Hola Jordi,

 

  I think that the problem comes from the fact that -diag-disable is a flag for the classic Intel compilers (icc and icpc, not the new icx and icpx). Can you compile PAPI using these compilers? If not, can you tweak the PAPI Makefiles or configure scripts in order not to use “-diag-disable 188,869,271” ?

 

Salut

--
You received this message because you are subscribed to the Google Groups "ptools-perfapi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptools-perfap...@icl.utk.edu.
To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/ptools-perfapi/e634315f-bb77-4b54-b8eb-6a3e89307f40n%40icl.utk.edu.


-----------------------------------------------------------
Intel Corporation Iberia, S.A.
Registered Office: Torre Picasso, 25th Floor,
Plaza Pablo Ruiz Picasso, no. 1, 28020  Madrid

Este mensaje se dirige exclusivamente a su destinatario y puede
contener informacion privilegiada o confidencial. Si no es vd.
el destinatario indicado, queda notificado de que la lectura,
utilizacion, divulgacion y,o copia sin autorizacion esta prohibida
en virtud de la legislacion vigente. Si ha recibido este mensaje por
error, le rogamos que nos lo communique inmediatamente por
esta misma via y proceda a su destruccion.

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Jordi Alcaraz

unread,
Nov 30, 2022, 6:37:22 PM11/30/22
to ptools-perfapi, harald.servat
Hola Harald,

I removed that part from the configure and tried to compile again (I may have not understood what you wrote as it is using icc and not icx).

With this change, a lot lines similar to the following appeared:
g++ -g  -DPAPI_NUM_COMP=4 -DDEBUG  -I../../../testlib -o gpu_query_gemm gpu_query_gemm.o gpu_common_utils.o -L/usr/lib -lze_loader ../../../libpapi.a -lsupc++ -lstdc++ -ldl -lstdc++
/usr/bin/ld: ../../../libpapi.a(papi.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ../../../libpapi.a(papi_internal.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ../../../libpapi.a(papi_hl.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ../../../libpapi.a(extras.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a PIE object; recompile with -fPIE

Followed by:
usr/bin/ld: gpu_common_utils.o: in function `parseInputParam':
/storage/users/jalcaraz/papi7/papi-7.0.0/src/components/intel_gpu/tests/gpu_common_utils.c:103: undefined reference to `__intel_sse2_strdup'
/usr/bin/ld: gpu_common_utils.o: in function `parseMetricList':
/storage/users/jalcaraz/papi7/papi-7.0.0/src/components/intel_gpu/tests/gpu_common_utils.c:57: undefined reference to `__intel_sse2_strtok'
/usr/bin/ld: /storage/users/jalcaraz/papi7/papi-7.0.0/src/components/intel_gpu/tests/gpu_common_utils.c:65: undefined reference to `__intel_sse2_strtok'

In the case of trying to use icpx:
  • export CC=icx
  • export CPP=icpx
  • make clean
  •  ./configure --with-components="intel_gpu" 
    Outputs:
    • configure: error: C preprocessor "icpx" fails sanity check

    Servat, Harald

    unread,
    Nov 30, 2022, 7:17:36 PM11/30/22
    to Jordi Alcaraz, ptools-perfapi, Servat, Harald

    Hola,

     

      Looks like now you’re in a moment in which you have some object files compiled with Intel classic compilers (icc/icpc) and some others with GNU. I’m not sure if that would work without any further change (especially given the __intel_sse2_* references).

     

      Since it looks that you have icc and icpc, is there any way you can force the module to be compiled with these compilers rather than using GNU compiler?

     

    Salut,

    Jordi Alcaraz

    unread,
    Nov 30, 2022, 9:04:55 PM11/30/22
    to ptools-perfapi, harald.servat, Jordi Alcaraz
    It fails the sanity check with icc/icpc, you can find attached the config.log where the compilations of the sanity check fail.
    The problems seems to be after line 152, where it literally says "choke me" when trying to compile with ifort and later it also fails with icpc.
    config.log

    Servat, Harald

    unread,
    Dec 1, 2022, 9:38:03 AM12/1/22
    to Jordi Alcaraz, ptools-perfapi, Servat, Harald

    Hello,

     

      @Jordi Alcaraz – just checked on my end . The following worked for me. You may want to start with a clean package – or use make distclean before doing this in order to clean your object files.

     

      FC=gfortran CC=gcc CXX=g++ ./configure --with-components="intel_gpu"

     

      @PAPI team – please note that the following configure line fails because the configure below does not keep track of CXX and some of the intel_gpu files are written in C++ and since CXX is not captured, g++ (rather than icpc) is used. That leads to flag collisions between icc/icpc and gnu compiler flags.

     

      FC=ifort CC=icc CXX=icpc ./configure --with-components="intel_gpu" --prefix=$PWD/install

     

      I was looking if PAPI could support it. Basically, configure.in would need an AC_PROG_CXX statement similar to AC_PROG_CC and then pass the CXX compiler to the necessary Makefiles. However, I don’t see how components/intel_gpu/Rules.intel_gpu can use that CXX definition.

     

    Best,

    Message has been deleted
    Message has been deleted

    Jordi Alcaraz

    unread,
    Dec 1, 2022, 7:25:55 PM12/1/22
    to ptools-perfapi, harald.servat, Jordi Alcaraz
    Hello Harald,

    Now it compiles and installs without problems.
    However, there seems to be another problem, as I can execute code in the GPU:
    • cd papi-7.0.0/src/components/intel_gpu/tests
    • ./gpu_gemm
    Output:
    Level Zero Matrix Multiplication (matrix size: 1024 x 1024, repeats 4 times)
    Target device: Intel(R) Iris(R) Xe MAX Graphics [0x4905]
    Matrix multiplication time: 0.0161849 sec
    Matrix multiplication time: 0.0154192 sec
    Matrix multiplication time: 0.0154332 sec
    Matrix multiplication time: 0.0154433 sec
    Total execution time: 0.191503 sec




    But after I  do as the readme.txt says:
    • export ZET_ENABLE_METRICS=1
    • export ZET_ENABLE_API_TRACING_EXP=1
    • cat /proc/sys/kernel/perf_event_paranoid
      -1
    • cat  /proc/sys/dev/i915/perf_stream_paranoid
      0
    And execute the example again:
    ./gpu_gemm
    gpu_gemm: gpu_query_gemm.cc:357: int main(int, char**): Assertion `status == ZE_RESULT_SUCCESS' failed.
    Aborted (core dumped)

    The problem comes from enabling ZET_ENABLE_METRICS


    Thank you,
    Jordi Alcaraz

    Peinan Zhang

    unread,
    Dec 2, 2022, 12:00:18 AM12/2/22
    to Jordi Alcaraz, ptools-perfapi, harald.servat
    Hi, Jordi,

    Can you unset ZET_ENABLE_API_TRACING_EXP to run "gpu_gemm"?  You can have ZET_ENABLE_METRICS=1 to enable metrics collection through a time-based approach.
    ZET_ENABLE_API_TRACING_EXP setting is to enable metrics query through API tracing, which may not well support in some early HWs and some early kernel versions.

    Thanks,
    --Peinan



    Jordi Alcaraz

    unread,
    Dec 2, 2022, 12:29:35 PM12/2/22
    to ptools-perfapi, pei...@gmail.com, ptools-perfapi, harald.servat, Jordi Alcaraz
    Hi Peinan,

    The problem I see is that with ZET_ENABLE_METRICS=1, the output is


    ./gpu_gemm
    gpu_gemm: gpu_query_gemm.cc:357: int main(int, char**): Assertion `status == ZE_RESULT_SUCCESS' failed.
    Aborted (core dumped)


    In the same way, the output of papi_component_avail is:


    InitMetricDevices failed, device does not exist or cannot find dependent libraries, abort
    Available components and hardware information.
    --------------------------------------------------------------------------------
    PAPI version             : 7.0.0.0
    Operating system         : Linux 5.4.48-xe-max
    Vendor string and code   : GenuineIntel (1, 0x1)
    Model string and code    : Intel(R) Xeon(R) Gold 6348H CPU @ 2.30GHz (85, 0x55)
    CPU revision             : 11.000000
    CPUID                    : Family/Model/Stepping 6/85/11, 0x06/0x55/0x0b
    CPU Max MHz              : 4200
    CPU Min MHz              : 1000
    Total cores              : 192
    SMT threads per core     : 2
    Cores per socket         : 24
    Sockets                  : 4
    Cores per NUMA region    : 48
    NUMA regions             : 4
    Running in a VM          : no
    Number Hardware Counters : 10
    Max Multiplex Counters   : 384
    Fast counter read (rdpmc): yes
    --------------------------------------------------------------------------------

    Compiled-in components:
    Name:   perf_event              Linux perf_event CPU counters
    Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
    Name:   intel_gpu               Intel GPU performance metrics
       \-> Disabled: The intel_gpu component does not detect metrics device.
    Name:   sysdetect               System info detection component

    Active components:
    Name:   perf_event              Linux perf_event CPU counters
                                    Native: 175, Preset: 59, Counters: 10
                                    PMUs supported: ix86arch, perf, perf_raw, clx

    Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
                                    Native: 3350, Preset: 0, Counters: 188
                                    PMUs supported: rapl, skx_unc_cha0, skx_unc_cha1, skx_unc_cha2, skx_unc_cha3, skx_unc_cha4
                                                    skx_unc_cha5, skx_unc_cha6, skx_unc_cha7, skx_unc_cha8, skx_unc_cha9
                                                    skx_unc_cha10, skx_unc_cha11, skx_unc_cha12, skx_unc_cha13, skx_unc_cha14
                                                    skx_unc_cha15, skx_unc_cha16, skx_unc_cha17, skx_unc_cha18, skx_unc_cha19
                                                    skx_unc_cha20, skx_unc_cha21, skx_unc_cha22, skx_unc_cha23, skx_unc_iio0
                                                    skx_unc_iio1, skx_unc_iio2, skx_unc_iio3, skx_unc_iio4, skx_unc_iio5, skx_unc_imc0
                                                    skx_unc_imc1, skx_unc_imc2, skx_unc_imc3, skx_unc_imc4, skx_unc_imc5, skx_unc_m2m0
                                                    skx_unc_m2m1, skx_unc_m3upi0, skx_unc_m3upi1, skx_unc_pcu, skx_unc_ubo
                                                    skx_unc_upi0, skx_unc_upi1, skx_unc_upi2

    Name:   sysdetect               System info detection component
                                    Native: 0, Preset: 0, Counters: 0


    --------------------------------------------------------------------------------


    Could it be possible that in the same way you say in some early versions the tracing is not supported, the metrics may not be supported?

    Best regards,
    Jordi Alcaraz

    Servat, Harald

    unread,
    Dec 5, 2022, 9:50:33 AM12/5/22
    to Jordi Alcaraz, ptools-perfapi, Servat, Harald

    Hello,

     

        Please note the following message from your output.

     

    Target LEVEL0 RTL -->   error: Double type is not supported on this platform.
    Target LEVEL0 RTL -->   in kernel: 'compute_target(double*, double*, double*, int, int, int)'
    Target LEVEL0 RTL -->   error: backend compiler failed build.

     

        DG1 does not support double precision natively. It supports double precision through emulation, though. So my suggestion is to follow one of the following:

     

    Best,

    Jordi Alcaraz

    unread,
    Dec 5, 2022, 12:56:21 PM12/5/22
    to ptools-perfapi, harald.servat, Jordi Alcaraz
    Hi Harald,

    The problem I have is that after setting ZET_ENABLE_METRICS=1, the code fails with:

    InitMetricDevices failed, device does not exist or cannot find dependent libraries, abort

    Could it be possible that in the same way you say in some early versions the tracing is not supported, the metrics may not be supported?

    Thank you,
    Jordi Alcaraz

    Servat, Harald

    unread,
    Dec 5, 2022, 5:57:44 PM12/5/22
    to Jordi Alcaraz, ptools-perfapi, Servat, Harald

    Hello,

     

      I’m sorry to say that I’m not sure about the support for metrics in Xe Max. Peinan may know better.

     

      Note that Peinan also pointed out that you may could try with a more recent kernel.

    Reply all
    Reply to author
    Forward
    0 new messages