Skip to content

Commit f730de1

Browse files
Merge pull request #1971 from IntelPython/set-subprocess-to-no-use-fork
Set subprocess to no use fork
2 parents 360ce45 + af3347a commit f730de1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

dpctl/_init_helper.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,20 @@
3232
os.add_dll_directory(dll_dir)
3333

3434
del is_venv_win32
35+
36+
is_linux = sys.platform.startswith("linux")
37+
38+
if is_linux:
39+
# forking is not supported by device drivers
40+
# Configure subprocess (used by versioneer) to
41+
# use SPAWN method over FORK method to enable
42+
# use of gdb-oneapi to debug code launched by
43+
# native extensions that used dpctl C/C++ API
44+
import subprocess
45+
46+
subprocess._USE_VFORK = False
47+
subprocess._USE_POSIX_SPAWN = True
48+
# remove qualifier from this namespace
49+
del subprocess
50+
51+
del is_linux

0 commit comments

Comments
 (0)