Skip to content

Commit 9ce1b55

Browse files
NXP backend: Fix passing env to executor cmd (pytorch#19063)
### Summary Fix of passing current env to subprocess call in execute_cmd(). Previous state where new env with 1 varible was passed prevented some tools from working correctly when call through subprocess call. ### Test plan Test for NXP executor runner. cc @robert-kalmar
1 parent c8c791a commit 9ce1b55

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

backends/nxp/tests_models/executors.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import subprocess
1212
from copy import deepcopy
1313
from enum import Enum
14-
from os import mkdir
14+
from os import environ, mkdir
1515
from typing import Callable
1616

1717
import numpy as np
@@ -598,7 +598,8 @@ def _get_caller_name():
598598

599599

600600
def execute_cmd(cmd, cwd="."):
601-
env = {"LD_LIBRARY_PATH": NSYS_PATH.parent}
601+
env = environ.copy() # Copy the current environment
602+
env["LD_LIBRARY_PATH"] = str(NSYS_PATH.parent)
602603

603604
with subprocess.Popen(
604605
cmd,

0 commit comments

Comments
 (0)