diff --git a/pkgs/development/python-modules/torch/source/default.nix b/pkgs/development/python-modules/torch/source/default.nix index b4a414b48d9d..6effc9ff55ca 100644 --- a/pkgs/development/python-modules/torch/source/default.nix +++ b/pkgs/development/python-modules/torch/source/default.nix @@ -46,6 +46,7 @@ # dependencies astunparse, + binutils, expecttest, filelock, fsspec, @@ -331,6 +332,10 @@ buildPythonPackage rec { # flag from cmakeFlags doesn't work, not clear why # setting it at the top of NNPACK's own CMakeLists does sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt + + # Ensure that torch profiler unwind uses addr2line from nix + substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \ + --replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"' '' + lib.optionalString rocmSupport '' # https://github.com/facebookincubator/gloo/pull/297