Add Xilinx xocl derivation

Need to move to raccoon to access "config" attribute.
This commit is contained in:
Rodrigo Arias 2025-02-20 12:49:33 +01:00
parent df8b5b2d67
commit 4ab38212b3
7 changed files with 68 additions and 20 deletions

View File

@ -34,6 +34,16 @@
services.openssh.settings.X11Forwarding = true;
nixpkgs.overlays = [
(final: prev: {
xilinx-xrt = prev.callPackage ./xilinx-xrt.nix { };
xilinx-xocl = prev.callPackage ./xilinx-xocl.nix {
kernel = config.boot.kernelPackages.kernel;
};
})
];
users.motd = ''

View File

@ -0,0 +1,27 @@
--- a/driver/xocl/mgmtpf/Makefile 2025-02-20 15:59:28.379826176 +0100
+++ b/driver/xocl/mgmtpf/Makefile 2025-02-20 15:59:42.366892140 +0100
@@ -119,10 +119,6 @@ all:
install: all
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
- depmod -a
- install -m 644 99-xclmgmt.rules /etc/udev/rules.d
- -rmmod -s xclmgmt || true
- -modprobe xclmgmt
clean:
rm -rf *.o *.o.d *.o.cmd *~ core .depend .*.cmd *.ko *.ko.unsigned \
--- a/driver/xocl/userpf/Makefile 2025-02-20 16:03:20.751922522 +0100
+++ b/driver/xocl/userpf/Makefile 2025-02-20 16:03:35.377991553 +0100
@@ -138,11 +138,6 @@ all:
install: all
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
- depmod -a
- install -m 644 99-xocl.rules /etc/udev/rules.d
- -rmmod -s xocl || true
- -rmmod -s xdma || true
- -modprobe xocl
clean:
rm -rf *.o *.o.d *~ core .depend .*.cmd *.ko *.ko.unsigned *.mod.c \

28
m/raccoon/xilinx-xocl.nix Normal file
View File

@ -0,0 +1,28 @@
{
stdenv
, lib
, kernel
, xilinx-xrt
}:
with lib;
stdenv.mkDerivation rec {
pname = "xilinx-xocl";
version = "2.19.0";
src = "${xilinx-xrt}/src/xrt-${version}";
dontStrip = true;
preBuild = ''
cd driver/xocl
'';
patches = [
./xilinx-xocl-depmod.patch
];
buildFlags = [ "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
installFlags = [
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=${placeholder "out"}"
];
nativeBuildInputs = kernel.moduleBuildDependencies;
hardeningDisable = [ "all" ];
}

View File

@ -21,7 +21,6 @@
, libsystemtap
, libxcrypt
, udev
#, glibc
}:
with lib;
@ -38,12 +37,10 @@ stdenv.mkDerivation rec {
};
dontStrip = true;
patches = [
./aiebu.patch
./xilinx-xrt-aiebu.patch
./xilinx-xrt-icd.patch
];
cmakeFlags = [
#"--trace-expand"
#"--debug-find-pkg=OpenCL"
"-DXRT_INSTALL_PREFIX=${placeholder "out"}"
"-DXRT_INSTALL_DIR=${placeholder "out"}"
"-DXRT_NATIVE_BUILD=yes"
@ -62,23 +59,10 @@ stdenv.mkDerivation rec {
mv "$fn.tmp" "$fn"
done
'';
# preBuild = ''
# set -x
# cat CMakeCache.txt
# echo --------------------------------------
# grep -R '/var/empty' .
# echo --------------------------------------
# set +x
# exit 1
# '';
buildFlags = [
#"VERBOSE=1"
];
nativeBuildInputs = [ cmake pkg-config git ];
buildInputs = [ libdrm.dev opencl-headers ocl-icd boost.dev ncurses
openssl.dev rapidjson protobuf python3 libelf libuuid.dev curl.dev libsystemtap
libxcrypt udev.out udev.dev
#glibc.static
openssl.dev rapidjson protobuf python3 libelf libuuid.dev curl.dev
libsystemtap libxcrypt udev.out udev.dev
];
hardeningDisable = [ "all" ];
}

View File

@ -42,5 +42,4 @@ final: prev:
});
prometheus-slurm-exporter = prev.callPackage ./slurm-exporter.nix { };
xilinx-xrt = prev.callPackage ./xilinx-xrt.nix { };
}