Skip to content

Commit

Permalink
Fixed subprocess creation under windows (#4820)
Browse files Browse the repository at this point in the history
* fixed subprocess creation under windows 

this addresses  the issue #4819

* Update server.py
  • Loading branch information
Coderx7 authored Feb 5, 2020
1 parent fc7dd6d commit 019356f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/tvm/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import time
import sys
import signal
import platform
import tvm._ffi

from tvm._ffi.base import py_str
Expand Down Expand Up @@ -363,7 +364,10 @@ def __init__(self,
# interim, stop the pylint diagnostic.
#
# pylint: disable=subprocess-popen-preexec-fn
self.proc = subprocess.Popen(cmd, preexec_fn=os.setsid)
if platform.system() == "Windows":
self.proc = subprocess.Popen(cmd, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
else:
self.proc = subprocess.Popen(cmd, preexec_fn=os.setsid)
time.sleep(0.5)
elif not is_proxy:
sock = socket.socket(base.get_addr_family((host, port)), socket.SOCK_STREAM)
Expand Down

0 comments on commit 019356f

Please sign in to comment.