From c862093d0de5e1066c80110927fc9aa925b2cbc6 Mon Sep 17 00:00:00 2001 From: Robbie Buxton <138501839+rbpdt@users.noreply.github.com> Date: Sun, 15 Jun 2025 21:36:14 -0400 Subject: [PATCH] python3Packages.torch: use addr2line from nix --- pkgs/development/python-modules/torch/source/default.nix | 5 +++++ 1 file changed, 5 insertions(+) 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