From 7db2c121e88379311448fa9005a6d6ee2619f555 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Mon, 21 Mar 2022 09:45:08 -0500 Subject: [PATCH 1/2] Clean up task can call PyGILState_Ensure if interpreter has started and if it is not finilizing/shutting-down --- dpctl/_host_task_util.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpctl/_host_task_util.hpp b/dpctl/_host_task_util.hpp index 7871cdebfc..73981f623a 100644 --- a/dpctl/_host_task_util.hpp +++ b/dpctl/_host_task_util.hpp @@ -56,7 +56,7 @@ int async_dec_ref(DPCTLSyclQueueRef QRef, } cgh.host_task([obj_array_size, obj_vec]() { // if the main thread has not finilized the interpreter yet - if (Py_IsInitialized()) { + if (Py_IsInitialized() && !_Py_IsFinalizing()) { PyGILState_STATE gstate; gstate = PyGILState_Ensure(); for (size_t i = 0; i < obj_array_size; ++i) { From 1c718b34eae4586b75842f8726294a6d22b4d6d4 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Mon, 21 Mar 2022 10:07:51 -0500 Subject: [PATCH 2/2] Disable faulthandler pytest plugin also on Linux --- conda-recipe/run_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/run_test.sh b/conda-recipe/run_test.sh index f21c4f7dc0..66193be58c 100644 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -4,4 +4,4 @@ set -e ${PYTHON} -c "import dpctl; print(dpctl.__version__)" ${PYTHON} -c "import dpctl; dpctl.lsplatform()" -${PYTHON} -m pytest -q -ra --disable-warnings --cov dpctl --cov-report term-missing --pyargs dpctl -vv +${PYTHON} -m pytest -q -ra --disable-warnings -p no:faulthandler --cov dpctl --cov-report term-missing --pyargs dpctl -vv