python312Packages.tinygrad: patch cuda headers

This commit is contained in:
Gaetan Lepage 2024-10-08 18:02:34 +02:00 committed by Gaétan Lepage
parent ba70efeed0
commit 0d71bb909f

View File

@ -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" \