Skip to content

Commit 0d71bb9

Browse files
committed
python312Packages.tinygrad: patch cuda headers
1 parent ba70efe commit 0d71bb9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkgs/development/python-modules/tinygrad/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ buildPythonPackage rec {
7474
substituteInPlace tinygrad/runtime/ops_clang.py \
7575
--replace-fail "'clang'" "'${lib.getExe clang}'"
7676
''
77+
# `cuda_fp16.h` and co. are needed at runtime to compile kernels
78+
+ lib.optionalString cudaSupport ''
79+
substituteInPlace tinygrad/runtime/support/compiler_cuda.py \
80+
--replace-fail \
81+
', "-I/usr/local/cuda/include", "-I/usr/include", "-I/opt/cuda/include/"' \
82+
', "-I${lib.getDev cudaPackages.cuda_cudart}/include/"'
83+
''
7784
+ lib.optionalString rocmSupport ''
7885
substituteInPlace tinygrad/runtime/autogen/hip.py \
7986
--replace-fail "/opt/rocm/lib/libamdhip64.so" "${rocmPackages.clr}/lib/libamdhip64.so" \

0 commit comments

Comments
 (0)