1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 vulkan-headers,
8 vulkan-loader,
9 fmt,
10 spdlog,
11 glslang,
12 ninja,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "kompute";
17 version = "0.9.0";
18
19 src = fetchFromGitHub {
20 owner = "KomputeProject";
21 repo = "kompute";
22 rev = "v${version}";
23 hash = "sha256-cf9Ef85R+VKao286+WHLgBWUqgwvuRocgeCzVJOGbdc=";
24 };
25
26 cmakeFlags = [
27 "-DKOMPUTE_OPT_USE_SPDLOG=ON"
28 # Doesn’t work without the vendored `spdlog`, and is redundant.
29 "-DKOMPUTE_OPT_LOG_LEVEL_DISABLED=ON"
30 "-DKOMPUTE_OPT_USE_BUILT_IN_SPDLOG=OFF"
31 "-DKOMPUTE_OPT_USE_BUILT_IN_FMT=OFF"
32 "-DKOMPUTE_OPT_USE_BUILT_IN_GOOGLE_TEST=OFF"
33 "-DKOMPUTE_OPT_USE_BUILT_IN_PYBIND11=OFF"
34 "-DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF"
35 "-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON"
36 "-DKOMPUTE_OPT_INSTALL=1"
37 ];
38
39 patches = [
40 # FIXME: remove next update
41 (fetchpatch {
42 name = "vulkan-14-support.patch";
43 url = "https://github.com/KomputeProject/kompute/commit/299b11fb4b8a7607c5d2c27e2735f26b06ae8e29.patch";
44 sha256 = "sha256-JuoTQ+VjIdyF+I1IcT1ofbBjRS0Ibm2w6F2jrRJlx40=";
45 })
46 ];
47
48 nativeBuildInputs = [
49 cmake
50 ninja
51 ];
52 buildInputs = [
53 fmt
54 spdlog
55 ];
56 propagatedBuildInputs = [
57 glslang
58 vulkan-headers
59 vulkan-loader
60 ];
61
62 meta = with lib; {
63 description = "General purpose GPU compute framework built on Vulkan";
64 longDescription = ''
65 General purpose GPU compute framework built on Vulkan to
66 support 1000s of cross vendor graphics cards (AMD,
67 Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled,
68 asynchronous and optimized for advanced GPU data
69 processing usecases. Backed by the Linux Foundation"
70 '';
71 homepage = "https://kompute.cc/";
72 license = licenses.asl20;
73 maintainers = with maintainers; [ atila ];
74 platforms = platforms.linux;
75 };
76}