Skip to content

Commit

Permalink
BUG: fix subprocess log on linux (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
UranusSeven authored Aug 30, 2023
1 parent 87b345c commit 4a23d57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xinference/deploy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ async def create_worker_actor_pool(
) -> "MainActorPoolType":
from xorbits._mars.resource import cuda_count

subprocess_start_method = "forkserver" if os.name != "nt" else "spawn"

cuda_device_indices = []
cuda_visible_devices = os.environ.get("CUDA_VISIBLE_DEVICES")
if cuda_visible_devices:
Expand All @@ -46,6 +48,7 @@ async def create_worker_actor_pool(
n_process=n_process,
labels=labels,
envs=envs,
subprocess_start_method=subprocess_start_method,
logging_conf=logging_conf,
)
return pool
Expand All @@ -64,6 +67,7 @@ async def create_worker_actor_pool(
address=address,
n_process=n_process,
labels=labels,
subprocess_start_method=subprocess_start_method,
logging_conf=logging_conf,
)
return pool

0 comments on commit 4a23d57

Please sign in to comment.