Unverified Commit 2877041a authored by deftdawg's avatar deftdawg Committed by GitHub
Browse files

Update RoCM substitutions for tinygrad

AMD replaced their hardcoded `/opt/rocm/lib` paths with `ROCM_PATH, '/opt/rocm/'` variables, the old `substituteInPlace` no longer matched the strings and did the substitutions resulting in the libraries not being found at runtime.
parent eaa55af0
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -86,11 +86,10 @@ buildPythonPackage rec {
    ''
    + lib.optionalString rocmSupport ''
      substituteInPlace tinygrad/runtime/autogen/hip.py \
        --replace-fail "/opt/rocm/lib/libamdhip64.so" "${rocmPackages.clr}/lib/libamdhip64.so" \
        --replace-fail "/opt/rocm/lib/libhiprtc.so" "${rocmPackages.clr}/lib/libhiprtc.so" \
        --replace-fail "/opt/rocm/" "${rocmPackages.clr}/"

      substituteInPlace tinygrad/runtime/autogen/comgr.py \
        --replace-fail "/opt/rocm/lib/libamd_comgr.so" "${rocmPackages.rocm-comgr}/lib/libamd_comgr.so"
        --replace-fail "/opt/rocm/" "${rocmPackages.rocm-comgr}/"
    '';

  build-system = [ setuptools ];