Skip to content

Commit

Permalink
python312Packages.tinygrad: patch cuda headers
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Oct 9, 2024
1 parent ba70efe commit 0d71bb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/development/python-modules/tinygrad/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ buildPythonPackage rec {
substituteInPlace tinygrad/runtime/ops_clang.py \
--replace-fail "'clang'" "'${lib.getExe clang}'"
''
# `cuda_fp16.h` and co. are needed at runtime to compile kernels
+ lib.optionalString cudaSupport ''
substituteInPlace tinygrad/runtime/support/compiler_cuda.py \
--replace-fail \
', "-I/usr/local/cuda/include", "-I/usr/include", "-I/opt/cuda/include/"' \
', "-I${lib.getDev cudaPackages.cuda_cudart}/include/"'
''
+ lib.optionalString rocmSupport ''
substituteInPlace tinygrad/runtime/autogen/hip.py \
--replace-fail "/opt/rocm/lib/libamdhip64.so" "${rocmPackages.clr}/lib/libamdhip64.so" \
Expand Down

0 comments on commit 0d71bb9

Please sign in to comment.