xe vomit
This commit is contained in:
parent
339ef75baf
commit
8f97a15738
2 changed files with 220 additions and 167 deletions
|
|
@ -156,35 +156,33 @@ let
|
||||||
buildSccacheLauncher = mkSccacheLauncher {
|
buildSccacheLauncher = mkSccacheLauncher {
|
||||||
name = "build-sccache";
|
name = "build-sccache";
|
||||||
};
|
};
|
||||||
mkBuildSccacheAttrs =
|
mkBuildSccacheAttrs = old: {
|
||||||
old:
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ buildSccacheLauncher ];
|
||||||
{
|
|
||||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ buildSccacheLauncher ];
|
|
||||||
|
|
||||||
preConfigure = (old.preConfigure or "") + ''
|
preConfigure = (old.preConfigure or "") + ''
|
||||||
|
|
||||||
mkdir -p ${final.lib.escapeShellArg sandboxSccacheDir}
|
mkdir -p ${final.lib.escapeShellArg sandboxSccacheDir}
|
||||||
export SCCACHE_SERVER_UDS="$TMPDIR/sccache/server.sock"
|
export SCCACHE_SERVER_UDS="$TMPDIR/sccache/server.sock"
|
||||||
export SCCACHE_IDLE_TIMEOUT=0
|
export SCCACHE_IDLE_TIMEOUT=0
|
||||||
unset SCCACHE_NO_DAEMON
|
unset SCCACHE_NO_DAEMON
|
||||||
mkdir -p "$(dirname "$SCCACHE_SERVER_UDS")"
|
mkdir -p "$(dirname "$SCCACHE_SERVER_UDS")"
|
||||||
if ! ${buildSccacheLauncher}/bin/build-sccache --show-stats >/dev/null 2>&1; then
|
if ! ${buildSccacheLauncher}/bin/build-sccache --show-stats >/dev/null 2>&1; then
|
||||||
rm -f "$SCCACHE_SERVER_UDS"
|
rm -f "$SCCACHE_SERVER_UDS"
|
||||||
if ! ${buildSccacheLauncher}/bin/build-sccache --start-server >/tmp/sccache-start.log 2>&1; then
|
if ! ${buildSccacheLauncher}/bin/build-sccache --start-server >/tmp/sccache-start.log 2>&1; then
|
||||||
if ! grep -Fq "Address already in use" /tmp/sccache-start.log; then
|
if ! grep -Fq "Address already in use" /tmp/sccache-start.log; then
|
||||||
cat /tmp/sccache-start.log >&2
|
cat /tmp/sccache-start.log >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
'';
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
postBuild = (old.postBuild or "") + ''
|
postBuild = (old.postBuild or "") + ''
|
||||||
|
|
||||||
${buildSccacheLauncher}/bin/build-sccache --show-stats --stats-format text || true
|
${buildSccacheLauncher}/bin/build-sccache --show-stats --stats-format text || true
|
||||||
${buildSccacheLauncher}/bin/build-sccache --stop-server || true
|
${buildSccacheLauncher}/bin/build-sccache --stop-server || true
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
mkCmakeSccacheAttrs =
|
mkCmakeSccacheAttrs =
|
||||||
old:
|
old:
|
||||||
let
|
let
|
||||||
|
|
@ -271,27 +269,28 @@ let
|
||||||
sccacheDir ? "/var/cache/sccache/nix-builds/packages",
|
sccacheDir ? "/var/cache/sccache/nix-builds/packages",
|
||||||
extraConfig ? "",
|
extraConfig ? "",
|
||||||
}:
|
}:
|
||||||
final.overrideCC stdenv (
|
final.overrideCC stdenv (mkWrappedCcForSccache {
|
||||||
mkWrappedCcForSccache {
|
inherit (stdenv) cc;
|
||||||
inherit (stdenv) cc;
|
extraConfig = mkSccacheExtraConfig {
|
||||||
extraConfig = mkSccacheExtraConfig {
|
inherit extraConfig sccacheDir;
|
||||||
inherit extraConfig sccacheDir;
|
};
|
||||||
};
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sccache = modify prev.sccache (old: {
|
sccache = modify prev.sccache (old: {
|
||||||
postPatch = (old.postPatch or "") + ''
|
postPatch = (old.postPatch or "") + ''
|
||||||
substituteInPlace src/compiler/gcc.rs \
|
substituteInPlace src/compiler/gcc.rs \
|
||||||
--replace-fail \
|
--replace-fail \
|
||||||
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),' \
|
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),' \
|
||||||
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
|
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
|
||||||
take_arg!("-cxx-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),'
|
take_arg!("-cxx-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),'
|
||||||
'';
|
'';
|
||||||
passthru = (old.passthru or { }) // {
|
passthru = (old.passthru or { }) // {
|
||||||
links =
|
links =
|
||||||
{ unwrappedCC, extraConfig ? "" }:
|
{
|
||||||
|
unwrappedCC,
|
||||||
|
extraConfig ? "",
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
sccacheLauncher = mkSccacheLauncher {
|
sccacheLauncher = mkSccacheLauncher {
|
||||||
name = "wrapped-sccache";
|
name = "wrapped-sccache";
|
||||||
|
|
@ -308,7 +307,8 @@ in
|
||||||
isSccache = true;
|
isSccache = true;
|
||||||
dev = unwrappedCC.dev or null;
|
dev = unwrappedCC.dev or null;
|
||||||
lib = unwrappedCC.lib or (final.lib.getLib unwrappedCC);
|
lib = unwrappedCC.lib or (final.lib.getLib unwrappedCC);
|
||||||
} // final.lib.optionalAttrs (unwrappedCC ? rsrc) {
|
}
|
||||||
|
// final.lib.optionalAttrs (unwrappedCC ? rsrc) {
|
||||||
inherit (unwrappedCC) rsrc;
|
inherit (unwrappedCC) rsrc;
|
||||||
};
|
};
|
||||||
dev = unwrappedCC.dev or null;
|
dev = unwrappedCC.dev or null;
|
||||||
|
|
@ -362,35 +362,41 @@ in
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
sccacheWrapper =
|
sccacheWrapper =
|
||||||
final.lib.makeOverridable (
|
final.lib.makeOverridable
|
||||||
|
(
|
||||||
|
{
|
||||||
|
extraConfig ? "",
|
||||||
|
cc,
|
||||||
|
}:
|
||||||
|
mkWrappedCcForSccache {
|
||||||
|
inherit cc extraConfig;
|
||||||
|
}
|
||||||
|
)
|
||||||
{
|
{
|
||||||
extraConfig ? "",
|
extraConfig = "";
|
||||||
cc,
|
inherit (final.stdenv) cc;
|
||||||
}:
|
};
|
||||||
mkWrappedCcForSccache {
|
|
||||||
inherit cc extraConfig;
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
extraConfig = "";
|
|
||||||
inherit (final.stdenv) cc;
|
|
||||||
};
|
|
||||||
sccacheStdenv = final.lib.lowPrio (
|
sccacheStdenv = final.lib.lowPrio (
|
||||||
final.lib.makeOverridable (
|
final.lib.makeOverridable
|
||||||
{
|
(
|
||||||
stdenv,
|
{
|
||||||
...
|
stdenv,
|
||||||
}@extraArgs:
|
...
|
||||||
final.overrideCC stdenv (
|
}@extraArgs:
|
||||||
final.buildPackages.sccacheWrapper.override (
|
final.overrideCC stdenv (
|
||||||
{ inherit (stdenv) cc; }
|
final.buildPackages.sccacheWrapper.override (
|
||||||
// final.lib.optionalAttrs (builtins.hasAttr "extraConfig" extraArgs) {
|
{
|
||||||
extraConfig = extraArgs.extraConfig;
|
inherit (stdenv) cc;
|
||||||
}
|
}
|
||||||
|
// final.lib.optionalAttrs (builtins.hasAttr "extraConfig" extraArgs) {
|
||||||
|
extraConfig = extraArgs.extraConfig;
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) {
|
{
|
||||||
inherit (final) stdenv;
|
inherit (final) stdenv;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
sccache-config = sharedSccacheConfig;
|
sccache-config = sharedSccacheConfig;
|
||||||
intel-sycl = modify prev."intel-sycl" (
|
intel-sycl = modify prev."intel-sycl" (
|
||||||
|
|
@ -459,27 +465,23 @@ in
|
||||||
buildSccacheAttrs = mkBuildSccacheAttrs old;
|
buildSccacheAttrs = mkBuildSccacheAttrs old;
|
||||||
oldClangBasePath = "clang_base_path=\"${old.llvmCcAndBintools}\"";
|
oldClangBasePath = "clang_base_path=\"${old.llvmCcAndBintools}\"";
|
||||||
newClangBasePath = "clang_base_path=\"${realElectronClangBasePath}\"";
|
newClangBasePath = "clang_base_path=\"${realElectronClangBasePath}\"";
|
||||||
baseGnFlags = builtins.replaceStrings
|
baseGnFlags = builtins.replaceStrings [ oldClangBasePath ] [ newClangBasePath ] (old.gnFlags or "");
|
||||||
[ oldClangBasePath ]
|
electronGnFlags = "${baseGnFlags} cc_wrapper=\"${buildSccacheLauncher}/bin/build-sccache\"";
|
||||||
[ newClangBasePath ]
|
|
||||||
(old.gnFlags or "");
|
|
||||||
electronGnFlags =
|
|
||||||
"${baseGnFlags} cc_wrapper=\"${buildSccacheLauncher}/bin/build-sccache\"";
|
|
||||||
in
|
in
|
||||||
buildSccacheAttrs
|
buildSccacheAttrs
|
||||||
// {
|
// {
|
||||||
gnFlags = electronGnFlags;
|
gnFlags = electronGnFlags;
|
||||||
configurePhase = builtins.replaceStrings
|
configurePhase = builtins.replaceStrings [ old.gnFlags or "" ] [ electronGnFlags ] (
|
||||||
[ old.gnFlags or "" ]
|
old.configurePhase or ""
|
||||||
[ electronGnFlags ]
|
);
|
||||||
(old.configurePhase or "");
|
|
||||||
patches = builtins.filter (
|
patches = builtins.filter (
|
||||||
patch: builtins.baseNameOf (toString patch) != "39-angle-patchdir.patch"
|
patch: builtins.baseNameOf (toString patch) != "39-angle-patchdir.patch"
|
||||||
) (old.patches or [ ]);
|
) (old.patches or [ ]);
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace electron/patches/config.json \
|
substituteInPlace electron/patches/config.json \
|
||||||
--replace-fail '"repo": "src/third_party/angle/src"' '"repo": "src/third_party/angle"'
|
--replace-fail '"repo": "src/third_party/angle/src"' '"repo": "src/third_party/angle"'
|
||||||
'' + (old.postPatch or "");
|
''
|
||||||
|
+ (old.postPatch or "");
|
||||||
postFixup = (old.postFixup or "") + ''
|
postFixup = (old.postFixup or "") + ''
|
||||||
|
|
||||||
for angleLibName in \
|
for angleLibName in \
|
||||||
|
|
@ -504,99 +506,99 @@ in
|
||||||
prev.electron_39.override {
|
prev.electron_39.override {
|
||||||
electron-unwrapped = electronUnwrapped;
|
electron-unwrapped = electronUnwrapped;
|
||||||
};
|
};
|
||||||
oneapi-ccl = modify (prev.oneapi-ccl.override {
|
oneapi-ccl =
|
||||||
intel-sycl = final."intel-sycl";
|
modify
|
||||||
}) (
|
(prev.oneapi-ccl.override {
|
||||||
old:
|
intel-sycl = final."intel-sycl";
|
||||||
let
|
})
|
||||||
version = "2021.17.2";
|
(
|
||||||
intelSycl = final."intel-sycl".llvm;
|
old:
|
||||||
intelSyclDev = final.lib.getDev intelSycl;
|
let
|
||||||
intelSyclLib = final.lib.getLib intelSycl;
|
version = "2021.17.2";
|
||||||
levelZero = final.lib.getDev final.level-zero;
|
intelSycl = final."intel-sycl".llvm;
|
||||||
openclHeaders = final.opencl-headers;
|
intelSyclDev = final.lib.getDev intelSycl;
|
||||||
cmakeSccacheAttrs = mkCmakeSccacheAttrs old;
|
intelSyclLib = final.lib.getLib intelSycl;
|
||||||
in
|
levelZero = final.lib.getDev final.level-zero;
|
||||||
(versionBumpAttrs old.version version {
|
openclHeaders = final.opencl-headers;
|
||||||
inherit version;
|
cmakeSccacheAttrs = mkCmakeSccacheAttrs old;
|
||||||
|
in
|
||||||
|
(versionBumpAttrs old.version version {
|
||||||
|
inherit version;
|
||||||
|
|
||||||
src = prev.fetchFromGitHub {
|
src = prev.fetchFromGitHub {
|
||||||
owner = "uxlfoundation";
|
owner = "uxlfoundation";
|
||||||
repo = "oneCCL";
|
repo = "oneCCL";
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-dV1PadrcJSdwwpNxXAK1fo/B5p26Lvd36wqC+xM5KJM=";
|
hash = "sha256-dV1PadrcJSdwwpNxXAK1fo/B5p26Lvd36wqC+xM5KJM=";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
// cmakeSccacheAttrs
|
// cmakeSccacheAttrs
|
||||||
// {
|
// {
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
|
|
||||||
postPatch = (old.postPatch or "") + ''
|
postPatch = (old.postPatch or "") + ''
|
||||||
mkdir -p deps/level_zero
|
mkdir -p deps/level_zero
|
||||||
rm -rf deps/level_zero/include
|
rm -rf deps/level_zero/include
|
||||||
ln -s ${levelZero}/include/level_zero deps/level_zero/include
|
ln -s ${levelZero}/include/level_zero deps/level_zero/include
|
||||||
|
|
||||||
sed -i '/^#if defined(SYCL_LANGUAGE_VERSION) && defined (__INTEL_LLVM_COMPILER)$/,/^#endif$/c\
|
sed -i '/^#if defined(SYCL_LANGUAGE_VERSION) && defined (__INTEL_LLVM_COMPILER)$/,/^#endif$/c\
|
||||||
#cmakedefine CCL_ENABLE_SYCL\
|
#cmakedefine CCL_ENABLE_SYCL\
|
||||||
#cmakedefine CCL_ENABLE_ZE' include/oneapi/ccl/config.h.in
|
#cmakedefine CCL_ENABLE_ZE' include/oneapi/ccl/config.h.in
|
||||||
|
|
||||||
sed -i 's/^#define ICPX_VERSION 0$/#define ICPX_VERSION 140000/' src/common/utils/sycl_utils.hpp
|
sed -i 's/^#define ICPX_VERSION 0$/#define ICPX_VERSION 140000/' src/common/utils/sycl_utils.hpp
|
||||||
|
|
||||||
sed -i '/^inline sycl::event get_last_event(const sycl::queue &q) {$/, /^inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> &deps) {$/c\
|
sed -i '/^inline sycl::event get_last_event(const sycl::queue &q) {$/, /^inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> &deps) {$/c\
|
||||||
inline sycl::event get_last_event(const sycl::queue &q) {\
|
inline sycl::event get_last_event(const sycl::queue &q) {\
|
||||||
auto last_event_opt = q.ext_oneapi_get_last_event();\
|
auto last_event_opt = q.ext_oneapi_get_last_event();\
|
||||||
if (last_event_opt.has_value()) {\
|
if (last_event_opt.has_value()) {\
|
||||||
return last_event_opt.value();\
|
return last_event_opt.value();\
|
||||||
}\
|
}\
|
||||||
return sycl::event{};\
|
return sycl::event{};\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> \&deps) {' src/coll/algorithms/utils/sycl_coll_base.hpp
|
inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> \&deps) {' src/coll/algorithms/utils/sycl_coll_base.hpp
|
||||||
|
|
||||||
find src -type f \( -name '*.hpp' -o -name '*.cpp' \) \
|
find src -type f \( -name '*.hpp' -o -name '*.cpp' \) \
|
||||||
-exec sed -i 's/reqd_sub_group_size(sg_size)/reqd_sub_group_size(32)/g' {} +
|
-exec sed -i 's/reqd_sub_group_size(sg_size)/reqd_sub_group_size(32)/g' {} +
|
||||||
|
|
||||||
awk '
|
awk '
|
||||||
pending {
|
pending {
|
||||||
if ($0 ~ /^[[:space:]]*send_buf, new_send_count,/) {
|
if ($0 ~ /^[[:space:]]*send_buf, new_send_count,/) {
|
||||||
sub(/send_buf, new_send_count,/, "q, send_buf, new_send_count,")
|
sub(/send_buf, new_send_count,/, "q, send_buf, new_send_count,")
|
||||||
}
|
}
|
||||||
pending = 0
|
pending = 0
|
||||||
}
|
}
|
||||||
/^[[:space:]]*e = allgatherv_large\($/ {
|
/^[[:space:]]*e = allgatherv_large\($/ {
|
||||||
pending = 1
|
pending = 1
|
||||||
}
|
}
|
||||||
{ print }
|
{ print }
|
||||||
' src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp \
|
' src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp \
|
||||||
> src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp
|
> src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp
|
||||||
mv src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp \
|
mv src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp \
|
||||||
src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp
|
src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = (cmakeSccacheAttrs.cmakeFlags or [ ]) ++ [
|
cmakeFlags = (cmakeSccacheAttrs.cmakeFlags or [ ]) ++ [
|
||||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||||
"-DINTEL_SYCL_INCLUDE_DIRS=${intelSyclDev}/include"
|
"-DINTEL_SYCL_INCLUDE_DIRS=${intelSyclDev}/include"
|
||||||
"-DINTEL_SYCL_LIBRARIES=${intelSyclLib}/lib/libsycl.so"
|
"-DINTEL_SYCL_LIBRARIES=${intelSyclLib}/lib/libsycl.so"
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = (old.buildInputs or [ ]) ++ [ openclHeaders ];
|
buildInputs = (old.buildInputs or [ ]) ++ [ openclHeaders ];
|
||||||
|
|
||||||
meta = (old.meta or { }) // {
|
meta = (old.meta or { }) // {
|
||||||
broken = false;
|
broken = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
oneapi-math-sycl-blas = modify prev.oneapi-math-sycl-blas (
|
oneapi-math-sycl-blas = modify prev.oneapi-math-sycl-blas (old: mkCmakeSccacheAttrs old);
|
||||||
old: mkCmakeSccacheAttrs old
|
oneapi-math = modify prev.oneapi-math (old: mkCmakeSccacheAttrs old);
|
||||||
);
|
|
||||||
oneapi-math = modify prev.oneapi-math (
|
|
||||||
old: mkCmakeSccacheAttrs old
|
|
||||||
);
|
|
||||||
oneapi-dpl =
|
oneapi-dpl =
|
||||||
let
|
let
|
||||||
version = "2022.11.1";
|
version = "2022.11.1";
|
||||||
in
|
in
|
||||||
modify prev.oneapi-dpl (old:
|
modify prev.oneapi-dpl (
|
||||||
|
old:
|
||||||
(versionBumpAttrs old.version version {
|
(versionBumpAttrs old.version version {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
|
|
@ -647,21 +649,21 @@ inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
// {
|
// {
|
||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
(old.propagatedBuildInputs or [ ])
|
(old.propagatedBuildInputs or [ ])
|
||||||
++ (with pyPrev; [
|
++ (with pyPrev; [
|
||||||
docstring-parser
|
docstring-parser
|
||||||
filetype
|
filetype
|
||||||
jinja2
|
jinja2
|
||||||
openai
|
openai
|
||||||
])
|
])
|
||||||
++ [
|
++ [
|
||||||
pyFinal."haystack-experimental"
|
pyFinal."haystack-experimental"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = (old.meta or { }) // {
|
meta = (old.meta or { }) // {
|
||||||
broken = false;
|
broken = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
sseclient-py = modify pyPrev.sseclient-py (old: rec {
|
sseclient-py = modify pyPrev.sseclient-py (old: rec {
|
||||||
|
|
@ -725,12 +727,62 @@ inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::
|
||||||
old:
|
old:
|
||||||
let
|
let
|
||||||
cmakeSccacheAttrs = mkCmakeSccacheAttrs old;
|
cmakeSccacheAttrs = mkCmakeSccacheAttrs old;
|
||||||
|
#
|
||||||
|
# Build against the drm/tip 7.0.0-rc4 kernel headers for xe driver ABI compatibility
|
||||||
|
kernelSrc = builtins.fetchGit {
|
||||||
|
url = "https://gitlab.freedesktop.org/drm/tip.git";
|
||||||
|
rev = "61409ba11a36fa5aff4ce0f0086a6026a43c5bce";
|
||||||
|
shallow = true;
|
||||||
|
};
|
||||||
|
kernelHeaders = final.runCommand "xe-kernel-headers" { } ''
|
||||||
|
mkdir -p $out/include/drm
|
||||||
|
cp -v ${kernelSrc}/include/drm/xe_drm.h $out/include/drm/ 2>/dev/null || true
|
||||||
|
cp -v ${kernelSrc}/include/uapi/drm/xe_drm.h $out/include/drm/ 2>/dev/null || true
|
||||||
|
# Also copy other drm headers the compute runtime might need
|
||||||
|
for f in ${kernelSrc}/include/drm/*.h ${kernelSrc}/include/uapi/drm/*.h; do
|
||||||
|
[ -f "$f" ] && cp -v "$f" $out/include/drm/ 2>/dev/null || true
|
||||||
|
done
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
cmakeSccacheAttrs
|
cmakeSccacheAttrs
|
||||||
// {
|
// {
|
||||||
cmakeFlags = (cmakeSccacheAttrs.cmakeFlags or [ ]) ++ [
|
cmakeFlags = (cmakeSccacheAttrs.cmakeFlags or [ ]) ++ [
|
||||||
(prev.lib.cmakeBool "NEO_ENABLE_XE" true)
|
(prev.lib.cmakeBool "NEO_ENABLE_XE" true)
|
||||||
];
|
];
|
||||||
|
buildInputs = (old.buildInputs or [ ]) ++ [ kernelHeaders ];
|
||||||
|
postPatch = (old.postPatch or "") + ''
|
||||||
|
# Copy xe_drm.h from the drm/tip kernel into all compute-runtime header locations
|
||||||
|
if [ -f "${kernelHeaders}/include/drm/xe_drm.h" ]; then
|
||||||
|
for dest in \
|
||||||
|
third_party/uapi/drm-next/xe \
|
||||||
|
third_party/uapi/drm-uapi-helper/xe \
|
||||||
|
third_party/uapi-eudebug/drm \
|
||||||
|
; do
|
||||||
|
if [ -d "$dest" ]; then
|
||||||
|
cp -v "${kernelHeaders}/include/drm/xe_drm.h" "$dest/"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Patch GMM resource creation failures to be non-fatal.
|
||||||
|
# intel-gmmlib can't create resource info for BMG on kernel 7.0 xe driver
|
||||||
|
# in certain initialization paths. Patch the abort and add null guards.
|
||||||
|
|
||||||
|
# 1. resource_info.cpp: return nullptr instead of aborting
|
||||||
|
sed -i 's/UNRECOVERABLE_IF(resourceInfo->peekHandle() == 0);/if(resourceInfo->peekHandle() == 0) { delete resourceInfo; return nullptr; }/' \
|
||||||
|
shared/source/gmm_helper/resource_info.cpp
|
||||||
|
|
||||||
|
# 2. gmm.cpp: change UNRECOVERABLE_IF to graceful return first (line 104)
|
||||||
|
sed -i 's/UNRECOVERABLE_IF(this->gmmResourceInfo == nullptr);/if (this->gmmResourceInfo == nullptr) { return; }/' \
|
||||||
|
shared/source/gmm_helper/gmm.cpp
|
||||||
|
|
||||||
|
# 3. gmm.cpp: add null checks after GmmResourceInfo::create calls that lack them
|
||||||
|
# Lines 76 and 85 (line 103 already handled by step 2 after the UNRECOVERABLE_IF replacement)
|
||||||
|
sed -i '76a\ if (this->gmmResourceInfo == nullptr) { return; }' \
|
||||||
|
shared/source/gmm_helper/gmm.cpp
|
||||||
|
sed -i '87a\ if (this->gmmResourceInfo == nullptr) { return; }' \
|
||||||
|
shared/source/gmm_helper/gmm.cpp
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@
|
||||||
intel-ocl
|
intel-ocl
|
||||||
vpl-gpu-rt
|
vpl-gpu-rt
|
||||||
intel-compute-runtime
|
intel-compute-runtime
|
||||||
|
intel-compute-runtime.drivers
|
||||||
### intel-hw
|
### intel-hw
|
||||||
oneapi-ccl
|
oneapi-ccl
|
||||||
oneapi-dpl
|
oneapi-dpl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue