From 80b67f93fcbd57985b35db94e9788602334ea37f Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki <39967756+JanuszL@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:47:31 +0200 Subject: [PATCH] Fix DALI TF plugin source compilation during installation (#5448) - removes unnecessary escape characters from compilation commands for the DALI TF plugin stub and binary issues when the plugin is built from the source during installation. Before this change rpatch was incorrectly set to '$ORIGIN' instead of just $ORIGIN Signed-off-by: Janusz Lisiecki --- dali_tf_plugin/dali_tf_plugin_install_tool.py | 6 +++--- qa/TL0_tensorflow_plugin/test.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dali_tf_plugin/dali_tf_plugin_install_tool.py b/dali_tf_plugin/dali_tf_plugin_install_tool.py index 78b987be26..d33e83f423 100644 --- a/dali_tf_plugin/dali_tf_plugin_install_tool.py +++ b/dali_tf_plugin/dali_tf_plugin_install_tool.py @@ -341,7 +341,7 @@ def build(self): dali_lflags = "-L" + tmpdir + " -ldali" dali_cflags = "-I" + os.path.join(self.src_path, "include") - cmd = [compiler, "-Wl,-R,'$ORIGIN/..'", "-std=c++14", "-DNDEBUG", "-shared"] + cmd = [compiler, "-Wl,-R,$ORIGIN/..", "-std=c++14", "-DNDEBUG", "-shared"] cmd += dali_stub_src.split() cmd += ["-o"] cmd += dali_stub_lib.split() @@ -374,8 +374,8 @@ def build(self): root_include = "-I" + os.getenv("PREFIX", default="/usr") + "/include" cmd = [ compiler, - "-Wl,-R,'$ORIGIN/..'", - "-Wl,-rpath,'$ORIGIN'", + "-Wl,-R,$ORIGIN/..", + "-Wl,-rpath,$ORIGIN", cpp_ver, "-DNDEBUG", "-shared", diff --git a/qa/TL0_tensorflow_plugin/test.sh b/qa/TL0_tensorflow_plugin/test.sh index f231e0c899..60092468d7 100755 --- a/qa/TL0_tensorflow_plugin/test.sh +++ b/qa/TL0_tensorflow_plugin/test.sh @@ -25,6 +25,14 @@ test_body() { pip install ../../../nvidia-dali-tf-plugin*.tar.gz ${python_invoke_test} test_dali_tf_plugin.py:TestDaliTfPluginLoadOk + # Installing "current" dali tf (built against installed TF) - force rebuild without DALI using internal stubs + # and then install DALI again + pip uninstall -y `pip list | grep nvidia-dali-tf-plugin | cut -d " " -f1` || true + pip uninstall -y `pip list | grep nvidia-dali | cut -d " " -f1` || true + DALI_TF_ALWAYS_BUILD=1 pip install --no-deps ../../../nvidia-dali-tf-plugin*.tar.gz + pip install ../../../nvidia_dali_*.whl + ${python_invoke_test} test_dali_tf_plugin.py:TestDaliTfPluginLoadOk + # DALI TF run ${python_invoke_test} test_dali_tf_plugin_run.py