Skip to content

Commit

Permalink
Update RoCM substitutions for tinygrad
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deftdawg authored Dec 23, 2024
1 parent eaa55af commit 2877041
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkgs/development/python-modules/tinygrad/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down

0 comments on commit 2877041

Please sign in to comment.