compute-runtime icon indicating copy to clipboard operation
compute-runtime copied to clipboard

build error error: undefined reference to `_Z18__spirv_ImageWritePU3AS133__spirv_Image__void_2_0_0_0_0_0_1Dv4_iDv4_ji'

Open pvelesko opened this issue 1 year ago • 11 comments

neo-error.txt

Tried with building LLVM standalone and also with LLVM getting built alongside neo.

+ cmake -G Ninja -S neo -B neo/build -DCMAKE_INSTALL_PREFIX=/space/pvelesko/install/intel-compute-runtime/neo/23.52.28202.15 -DIGC_DIR=/space/pvelesko/install/intel-compute-runtime/igc/igc-1.0.15985.6 -DGMM_DIR=/space/pvelesko/install/intel-compute-runtime/gmmlib/ -DCMAKE_PREFIX_PATH=/space/pvelesko/install/intel-compute-runtime/igsc/ -DSKIP_UNIT_TESTS=ON -DOCL_ICD_VENDORDIR=/space/pvelesko/install/intel-compute-runtime/neo/23.52.28202.15/etc/OpenCL/vendors -DLevelZero_INCLUDE_DIR=/space/pvelesko/install/intel-compute-runtime/level-zero/23.52.28202.15/include -DNEO_ENABLE_i915_PRELIM_DETECTION=ON
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- branch dir list: /
-- Host processor: x86_64
-- Target processor: x86_64
-- Neo target processor: x86_64
-- CMAKE_BUILD_TYPE not specified, using Release
-- Performing Test COMPILER_SUPPORTS_LLD
-- Performing Test COMPILER_SUPPORTS_LLD - Success
-- Performing Test COMPILER_SUPPORTS_GOLD
-- Performing Test COMPILER_SUPPORTS_GOLD - Success
-- Using linker: ld.gold
-- Release build configuration
-- Aub Stream Headers dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/aub_stream
-- Khronos OpenCL headers dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/opencl_headers
-- Khronos OpenGL headers dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/opengl_headers
-- AOT config headers dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/aot_config_headers
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for module 'igc-opencl'
--   Found igc-opencl, version 1.0.1
-- IGC include dirs: /home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/igc;/home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/igc/cif;/home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/igc/ocl_igc_shared/executable_format;/home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/igc/ocl_igc_shared/device_enqueue
-- VISA Dir: /home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/visa
-- IGA Includes dir: /home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/include/iga
-- Checking for module 'igdgmm'
--   Found igdgmm, version 12.3.0
-- GmmLib include dirs: /home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm;/home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm/GmmLib;/home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm/GmmLib/inc;/home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm/inc;/home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm/inc/common;/home/pvelesko/space/install/intel-compute-runtime/gmmlib/include/igdgmm/util
-- Checking for module 'libigdml'
--   No package 'libigdml' found
-- Metrics Library dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/metrics_library
-- Checking for module 'libigdmd'
--   No package 'libigdmd' found
-- Metrics Discovery dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/metrics_discovery
-- Checking for module 'libva>=1.0.0'
--   No package 'libva' found
-- AUB_STREAM_DIR =
-- Engine node dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/aub_stream
-- All supported platforms:  PVC MTL DG2 ARL TGLLP DG1 RKL ADLS ADLP ADLN ICLLP LKF EHL SKL KBL GLK CFL BXT BDW
-- All tested platforms:
-- Default supported platform: PVC
-- Default tested platform:
-- All supported core families: GEN8;GEN9;GEN11;GEN12LP;XE_HPG_CORE;XE_HPC_CORE
-- All tested core families:
-- Default tested family name:
-- Platforms to have WDDM_LINUX disabled: PVC
-- WDK include paths: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/DirectX-Headers/include/wsl;/home/pvelesko/space/intel-compute-runtime-build/neo/third_party/DirectX-Headers/include/wsl/stubs;/home/pvelesko/space/intel-compute-runtime-build/neo/third_party/DirectX-Headers/include/directx;/home/pvelesko/space/intel-compute-runtime-build/neo/third_party/DirectX-Headers/include/dxguids;/home/pvelesko/space/intel-compute-runtime-build/neo/third_party/libdxg/include/
-- Driver model : drm_or_wddm
-- i915 prelim headers detection: ON
-- Xe drm detection: FALSE
-- i915 includes dir: /home/pvelesko/space/intel-compute-runtime-build/neo/third_party/uapi
-- Neo kernels build type dir: release
-- Performing Test COMPILER_SUPPORTS_INDIRECT_BRANCH_THUNK
-- Performing Test COMPILER_SUPPORTS_INDIRECT_BRANCH_THUNK - Failed
CMake Warning at CMakeLists.txt:693 (message):
  Spectre mitigation -mindirect-branch=thunk flag is not supported by the
  compiler


-- Performing Test COMPILER_SUPPORTS_FUNCTION_RETURN_THUNK
-- Performing Test COMPILER_SUPPORTS_FUNCTION_RETURN_THUNK - Failed
CMake Warning at CMakeLists.txt:699 (message):
  Spectre mitigation -mfunction-return=thunk flag is not supported by the
  compiler


-- Performing Test COMPILER_SUPPORTS_INDIRECT_BRANCH_REGISTER
-- Performing Test COMPILER_SUPPORTS_INDIRECT_BRANCH_REGISTER - Success
-- Performing Test COMPILER_SUPPORTS_SSE42
-- Performing Test COMPILER_SUPPORTS_SSE42 - Success
-- Performing Test COMPILER_SUPPORTS_AVX2
-- Performing Test COMPILER_SUPPORTS_AVX2 - Success
-- Performing Test COMPILER_SUPPORTS_NEON
-- Performing Test COMPILER_SUPPORTS_NEON - Failed
-- Performing Test SUPPORTS_CLFLUSHOPT
-- Performing Test SUPPORTS_CLFLUSHOPT - Success
-- Performing Test SUPPORTS_WAITPKG
-- Performing Test SUPPORTS_WAITPKG - Success
-- L0: Selected platforms for testing are not supported. Skipping tests.
-- Level Zero driver version: 1.3.28202
-- Found LevelZero: /home/pvelesko/space/install/intel-compute-runtime/level-zero/23.52.28202.15/include
-- LevelZero_INCLUDE_DIRS: /home/pvelesko/space/install/intel-compute-runtime/level-zero/23.52.28202.15/include
-- LibGenl headers not available. Building without
-- libudev headers directory: /usr/include
-- igsc Library headers directory: /home/pvelesko/space/intel-compute-runtime-build/igsc/include
-- igsc version: 0.8.16
-- L0::Igc Dir: /home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6
-- L0::Gmm Dir: /home/pvelesko/space/install/intel-compute-runtime/gmmlib
-- Prebuilt kernels are linked to Level Zero.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pvelesko/space/intel-compute-runtime-build/neo/build
++ nproc
+ cmake --build neo/build --config Release -j 32
[676/4738] Generating ../../../../bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_8_0_0.bin
FAILED: bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_8_0_0.bin /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_8_0_0.bin
cd /home/pvelesko/space/intel-compute-runtime-build/neo/shared/source/built_ins/kernels && /usr/bin/cmake -E env LD_LIBRARY_PATH=:/home/pvelesko/space/install/intel-compute-runtime/igc/igc-1.0.15985.6/lib/:/home/pvelesko/space/intel-compute-runtime-build/neo/build/bin /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/ocloc -q -file /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_bdw.spv -spirv_input -device 8.0.0 -cl-intel-greater-than-4GB-buffer-required -64 -output stateless_copy_buffer_to_image3d_stateless_8_0_0 -output_no_suffix -out_dir /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8 -options -cl-kernel-arg-info

error: undefined reference to `_Z18__spirv_ImageWritePU3AS133__spirv_Image__void_2_0_0_0_0_0_1Dv4_iDv4_ji'
in function: '__spirv_ImageWrite(__spirv_Image__void_2_0_0_0_0_0_1 AS1*, int vector[4], unsigned int vector[4], int)' called by kernels:
  - 'CopyBufferToImage3d16Bytes'
  - 'CopyBufferToImage3d8Bytes'
  - 'CopyBufferToImage3d4Bytes'
  - 'CopyBufferToImage3d2Bytes'
  - 'CopyBufferToImage3dBytes'

error: backend compiler failed build.

Build failed with error code: -11
Command was: /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/ocloc -q -file /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_bdw.spv -spirv_input -device 8.0.0 -cl-intel-greater-than-4GB-buffer-required -64 -output stateless_copy_buffer_to_image3d_stateless_8_0_0 -output_no_suffix -out_dir /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8 -options "-cl-kernel-arg-info"

pvelesko avatar Feb 02 '24 15:02 pvelesko

Hi @pvelesko

Could you try with IGC as of https://github.com/intel/intel-graphics-compiler/releases/tag/igc-1.0.15770.11 ? In release notes we provide which version of IGC was used for given release

JablonskiMateusz avatar Feb 05 '24 08:02 JablonskiMateusz

Not sure if this is related, but I'm getting very similar errors in Arch Linux since version 23.52.28202.14.

Version 24.05.28454.6 + IGC 1.0.15985.7 also gives me the same result in when building:

error: undefined reference to `__builtin_spirv_OpenCL_vload4_i64_p1i32_i32'
in function: '__builtin_spirv_OpenCL_vload4_i64_p1i32_i32' called by kernel: 'fullCopy'

error: backend compiler failed build.

error: undefined reference to `__builtin_spirv_OpenCL_vstore4_v4i32_i64_p1i32'
in function: '__builtin_spirv_OpenCL_vstore4_v4i32_i64_p1i32' called by kernel: 'fullCopy'

error: backend compiler failed build.

error: undefined reference to `__builtin_spirv_BuiltInGlobalInvocationId'
in function: '__builtin_spirv_BuiltInGlobalInvocationId' called by kernel: 'fullCopy'

error: backend compiler failed build.

Build failed with error code: -11
Command was: /build/intel-compute-runtime/src/build/bin/ocloc -q -file /build/intel-compute-runtime/src/build/bin/built_ins/x64/xe_hpc_core/stateless_aux_translation_pvc.spv -spirv_input -device 12.60.0 -cl-intel-greater-than-4GB-buffer-required -64 -output stateless_aux_translation_12_60_0 -output_no_suffix -out_dir /build/intel-compute-runtime/src/build/bin/built_ins/x64/xe_hpc_core -options "-cl-kernel-arg-info"

There are other similar errors following it in the compilation, like these:

error: undefined reference to `__builtin_spirv_BuiltInGlobalInvocationId'
in function: '__builtin_spirv_BuiltInGlobalInvocationId' called by kernels:
  - 'CopyBufferRectBytes2d'
  - 'CopyBufferRectBytes3d'

dbermond avatar Feb 15 '24 16:02 dbermond

@JablonskiMateusz Any update on this?

I tried using latest neo 24.09.28717.12 with igc 1.0.16238.4, and the problem still persists. Both neo and igc are built with the listed dependency commits from their release description.

dbermond avatar Mar 29 '24 20:03 dbermond

I got the same issue too, any solutions for this issue?

Yanfeng-Mi avatar Apr 01 '24 08:04 Yanfeng-Mi

Same issue here in Arch Linux with Version 24.09.28717.12 + ICG 1.0.16510.1

vidalinux avatar Apr 04 '24 14:04 vidalinux

@dbermond I was able to fix the compile issues on Arch Linux updating all PKGBUILD for IGC + dependencies, changes are available here: https://github.com/vidalinux/AUR:

vidalinux avatar Apr 08 '24 21:04 vidalinux

@JablonskiMateusz Any update on this?

The error message says directly that this is failure on compiler backend side. In the log there is also cmdline to reproduce the issue

Command was: /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/ocloc -q -file /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8/stateless_copy_buffer_to_image3d_stateless_bdw.spv -spirv_input -device 8.0.0 -cl-intel-greater-than-4GB-buffer-required -64 -output stateless_copy_buffer_to_image3d_stateless_8_0_0 -output_no_suffix -out_dir /home/pvelesko/space/intel-compute-runtime-build/neo/build/bin/built_ins/x64/gen8 -options "-cl-kernel-arg-info"

Please attach reproducer and create an issue in IGC repo

JablonskiMateusz avatar Apr 09 '24 06:04 JablonskiMateusz

@vidalinux I have not compiled/tested your setup, but currently it's not suitable because you are using different dependency versions for IGC in comparison to the ones specified by upstream. Although this may compile, it can have silent segmentation fault issues that are shown only at runtime, since IGC seems to be sensible to these versions. This have already happened in the past when we used binary dependencies. Also, your spirv-tools is 2024.1, which is ahead of the one shipped in the official repositories.

We have switched to using a source-based build for most IGC dependencies exactly for, among other things, avoid the problems described above, making sure that we are using dependencies that are tested by upstream, and the current intention is to stick with this type of build. This also helped a lot with building issues in IGC when we were using a binary (prebuild) llvm at a different version. For using your setup, we would need a spirv-llvm-translator15 (and so on) in the official repositories, and we are avoiding this by using a source-based build.

dbermond avatar Apr 10 '24 16:04 dbermond

Please attach reproducer and create an issue in IGC repo

@JablonskiMateusz Thank you for the reply. I have opened an issue in the IGC repository.

dbermond avatar Apr 10 '24 18:04 dbermond

@dbermond @JablonskiMateusz an issue has been open on igc for a while.

pvelesko avatar Apr 10 '24 22:04 pvelesko

It works fine for me when using IGC_OPTION__USE_KHRONOS_SPIRV_TRANSLATOR_IN_SC=OFF in IGC.

dbermond avatar Apr 28 '24 14:04 dbermond