Skip to content

Fix the connection between server and tracker when using WSL2 #17349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Fix] the connection between server and tracker when using WSL2
  • Loading branch information
gaoren002 committed Sep 9, 2024
commit f125df30cb33e6458709bc86c06f0e4c2f06a59d
13 changes: 11 additions & 2 deletions python/tvm/exec/rpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@
"""Start an RPC server"""
import argparse
import logging
from .. import rpc
import socket
from .. import rpc



def get_local_ip():
"""
Attempt to get the local IP address of the machine.

Returns:
--------
str or None
The IP address of the machine as a string if successful; None if failed.
"""
try:
# create UDP socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
Expand All @@ -32,7 +41,7 @@ def get_local_ip():
local_ip = s.getsockname()[0]
s.close()
return local_ip
except Exception:
except (socket.error, OSError):
return None


Expand Down
Loading