intel-compute-runtime-legacy1: vendor old intel-graphics-compiler
intel-graphics-compiler >= 2.36 does no longer support 8th Gen
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
From bc76a7087e4621269bdf9080581088a6c8f6b3a6 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Mayo <aklhfex@gmail.com>
|
||||
Date: Tue, 20 May 2025 19:27:57 +0100
|
||||
Subject: [PATCH] Raise minimum CMake version to 3.5
|
||||
|
||||
For compatibility with CMake 4.0, which also removes CMP0043 OLD - there
|
||||
are no uses of COMPILE_DEFINITIONS_<CONFIG>.
|
||||
|
||||
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
|
||||
---
|
||||
external/SPIRV-Tools/CMakeLists.txt | 2 +-
|
||||
visa/CMakeLists.txt | 7 +------
|
||||
visa/iga/GEDLibrary/GED_external/CMakeLists.txt | 6 +-----
|
||||
4 files changed, 4 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/external/SPIRV-Tools/CMakeLists.txt b/external/SPIRV-Tools/CMakeLists.txt
|
||||
index d2e3f63fb0d3..75f013409990 100644
|
||||
--- a/igc/external/SPIRV-Tools/CMakeLists.txt
|
||||
+++ b/igc/external/SPIRV-Tools/CMakeLists.txt
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
#============================ end_copyright_notice =============================
|
||||
|
||||
-cmake_minimum_required(VERSION 2.8.12)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
message(STATUS "============================ SPIRV-Tools project ============================")
|
||||
|
||||
diff --git a/visa/iga/GEDLibrary/GED_external/CMakeLists.txt b/visa/iga/GEDLibrary/GED_external/CMakeLists.txt
|
||||
index e40313fc1944..275fff1114a6 100644
|
||||
--- a/igc/visa/iga/GEDLibrary/GED_external/CMakeLists.txt
|
||||
+++ b/igc/visa/iga/GEDLibrary/GED_external/CMakeLists.txt
|
||||
@@ -7,11 +7,7 @@
|
||||
#============================ end_copyright_notice =============================
|
||||
|
||||
# GEDLibrary/GED
|
||||
-if(WIN32)
|
||||
- cmake_minimum_required(VERSION 3.1)
|
||||
-else()
|
||||
- cmake_minimum_required(VERSION 2.8.12)
|
||||
-endif(WIN32)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(GEDLibrary)
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
diff --git a/igc/IGC/common/LLVMWarningsPush.hpp b/igc/IGC/common/LLVMWarningsPush.hpp
|
||||
index 12874dfcc2..38acd80943 100644
|
||||
--- a/igc/IGC/common/LLVMWarningsPush.hpp
|
||||
+++ b/igc/IGC/common/LLVMWarningsPush.hpp
|
||||
@@ -43,6 +43,9 @@
|
||||
#if __GNUC__ > 8
|
||||
#pragma GCC diagnostic ignored "-Winit-list-lifetime"
|
||||
#endif
|
||||
+#if __GNUC__ > 14
|
||||
+#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/llvm-project/llvm/include/llvm/Support/Threading.h b/llvm-project/llvm/include/llvm/Support/Threading.h
|
||||
index ba6c531ab4..78aa5e7be5 100644
|
||||
--- a/llvm-project/llvm/include/llvm/Support/Threading.h
|
||||
+++ b/llvm-project/llvm/include/llvm/Support/Threading.h
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
|
||||
#include "llvm/Support/Compiler.h"
|
||||
-#include <ciso646> // So we can check the C++ standard lib macros.
|
||||
+#include <version> // So we can check the C++ standard lib macros.
|
||||
#include <optional>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
@@ -0,0 +1,156 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
ninja,
|
||||
git,
|
||||
bison,
|
||||
flex,
|
||||
zlib,
|
||||
intel-compute-runtime,
|
||||
python3,
|
||||
spirv-tools,
|
||||
spirv-headers,
|
||||
}:
|
||||
|
||||
let
|
||||
llvmVersion = "16.0.6";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "intel-graphics-compiler";
|
||||
version = "2.34.4";
|
||||
|
||||
# See the repository for expected versions:
|
||||
# <https://github.com/intel/intel-graphics-compiler/blob/v2.16.0/documentation/build_ubuntu.md#revision-table>
|
||||
srcs = [
|
||||
(fetchFromGitHub {
|
||||
name = "igc";
|
||||
owner = "intel";
|
||||
repo = "intel-graphics-compiler";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-w20nrn3wo9Dvv3BILYBzuJTTLXqcWaRAF7SiPtryhwk=";
|
||||
})
|
||||
(fetchFromGitHub {
|
||||
name = "llvm-project";
|
||||
owner = "llvm";
|
||||
repo = "llvm-project";
|
||||
tag = "llvmorg-${llvmVersion}";
|
||||
hash = "sha256-fspqSReX+VD+Nl/Cfq+tDcdPtnQPV1IRopNDfd5VtUs=";
|
||||
})
|
||||
(fetchFromGitHub {
|
||||
name = "vc-intrinsics";
|
||||
owner = "intel";
|
||||
repo = "vc-intrinsics";
|
||||
tag = "v0.25.0";
|
||||
hash = "sha256-ozc1w3V5RqWHwqNHuefZJMN8RAYxrJxH9bd1BEqxfiQ=";
|
||||
})
|
||||
(fetchFromGitHub {
|
||||
name = "opencl-clang";
|
||||
owner = "intel";
|
||||
repo = "opencl-clang";
|
||||
tag = "v16.0.11";
|
||||
hash = "sha256-ema1jTNMHs3pUituVb1NPllc6cA8eYJHtDOjuEzIDWM=";
|
||||
})
|
||||
(fetchFromGitHub {
|
||||
name = "llvm-spirv";
|
||||
owner = "KhronosGroup";
|
||||
repo = "SPIRV-LLVM-Translator";
|
||||
tag = "v16.0.24";
|
||||
hash = "sha256-aTcwfQt2WdOA44jfHdD7x7oxt8emSDexgZnI7MPVqvU=";
|
||||
})
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Raise minimum CMake version to 3.5
|
||||
# https://github.com/intel/intel-graphics-compiler/commit/4f0123a7d67fb716b647f0ba5c1ab550abf2f97d
|
||||
# https://github.com/intel/intel-graphics-compiler/pull/364
|
||||
./bump-cmake.patch
|
||||
|
||||
# Fix for GCC 15 by adding a previously-implicit `#include <cstdint>` and
|
||||
# replacing `<ciso646>` with `<version>` in the the llvm directory. Based
|
||||
# on https://github.com/intel/intel-graphics-compiler/pull/383.
|
||||
./gcc15-llvm-header-fixes.patch
|
||||
|
||||
# Fix for GCC 15 by disabling `-Werror` for `-Wfree-nonheap-object`
|
||||
# warnings within LLVM. This is in accordance with IGC disabling warnings
|
||||
# that originate from within LLVM (see `IGC/common/LLVMWarningsPush.hpp`).
|
||||
./gcc15-allow-llvm-free-nonheap-object-warning.patch
|
||||
];
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
cmakeDir = "../igc";
|
||||
|
||||
postUnpack = ''
|
||||
chmod -R +w .
|
||||
mv opencl-clang llvm-spirv llvm-project/llvm/projects/
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace igc/IGC/AdaptorOCL/igc-opencl.pc.in \
|
||||
--replace-fail '/@CMAKE_INSTALL_INCLUDEDIR@' "/include" \
|
||||
--replace-fail '/@CMAKE_INSTALL_LIBDIR@' "/lib"
|
||||
|
||||
chmod +x igc/IGC/Scripts/igc_create_linker_script.sh
|
||||
patchShebangs --build igc/IGC/Scripts/igc_create_linker_script.sh
|
||||
|
||||
# The build system only applies patches when the sources are in a
|
||||
# Git repository.
|
||||
git -C llvm-project init
|
||||
git -C llvm-project -c user.name=nixbld -c user.email= commit --allow-empty -m stub
|
||||
substituteInPlace llvm-project/llvm/projects/opencl-clang/cmake/modules/CMakeFunctions.cmake \
|
||||
--replace-fail 'COMMAND ''${GIT_EXECUTABLE} am --3way --keep-non-patch --ignore-whitespace -C0 ' \
|
||||
'COMMAND patch -p1 --ignore-whitespace -i '
|
||||
|
||||
# match default LLVM version with our provided version to apply correct patches
|
||||
substituteInPlace igc/external/llvm/llvm_preferred_version.cmake \
|
||||
--replace-fail "16.0.6" "${llvmVersion}"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
cmake
|
||||
flex
|
||||
git
|
||||
ninja
|
||||
(python3.withPackages (
|
||||
ps: with ps; [
|
||||
mako
|
||||
pyyaml
|
||||
]
|
||||
))
|
||||
zlib
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
spirv-headers
|
||||
spirv-tools
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
# testing is done via intel-compute-runtime
|
||||
doCheck = false;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DIGC_OPTION__SPIRV_TOOLS_MODE=Prebuilds"
|
||||
"-DIGC_OPTION__USE_PREINSTALLED_SPIRV_HEADERS=ON"
|
||||
"-DSPIRV-Headers_INCLUDE_DIR=${spirv-headers}/include"
|
||||
"-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}"
|
||||
"-Wno-dev"
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
inherit intel-compute-runtime;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "LLVM-based compiler for OpenCL targeting Intel Gen graphics hardware";
|
||||
homepage = "https://github.com/intel/intel-graphics-compiler";
|
||||
changelog = "https://github.com/intel/intel-graphics-compiler/releases/tag/v${version}";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ fleaz ];
|
||||
};
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
lib,
|
||||
callPackage,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
intel-gmmlib,
|
||||
intel-graphics-compiler,
|
||||
level-zero,
|
||||
libva,
|
||||
gitUpdater,
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
let
|
||||
inherit (lib) cmakeBool;
|
||||
# intel-graphics-compiler >= 2.36 does no longer support 8th Gen
|
||||
intel-graphics-compiler = callPackage ./intel-graphics-compiler.nix { };
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
# https://github.com/intel/compute-runtime/blob/master/LEGACY_PLATFORMS.md
|
||||
|
||||
Reference in New Issue
Block a user