Skip to content

Update OS check & Fix nvcc cmd issue #206

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

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ This is an extensive node suite that enables ComfyUI to process 3D inputs (Mesh
- **Switch Axis for 3DGS & 3D Mesh**
- Since different algorithms likely use different coordinate system, so the ability to re-mapping the axis of coordinate is crucial for passing generated result between differnt nodes.

- **[Customizable system config file](configs/system.conf)**
- **[Customizable system config file](Configs/system.conf)**
- Custom clients IP address

## Roadmap:
Expand Down
18 changes: 11 additions & 7 deletions _Pre_Builds/_Build_Scripts/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,29 @@
WHEELS_ROOT_ABS_PATH = os.path.join(BUILD_ROOT_ABS_PATH, build_config.wheels_dir_name)
LIBS_ROOT_ABS_PATH = os.path.join(BUILD_ROOT_ABS_PATH, build_config.libs_dir_name)

def get_os_type():
if platform.system() == "Windows":
return "win"
elif platform.system() == "Linux":
return "linux"
else:
raise NotImplementedError(f"Platform {platform.system()} not supported!")

def get_python_version():
# Output: only first two version numbers, e.g. 3.12.4 -> py312
return "py" + "".join(platform.python_version().split('.')[:-1])

def get_cuda_version():
# Output: e.g. "cu121" or cu118
result = subprocess.run(["nvcc", "--version"], shell=True, text=True, capture_output=True)
result = subprocess.run(["nvcc", "--version"], text=True, capture_output=True)
if result.returncode == 0:
for cuda_version in build_config.supported_cuda_versions:
if "cuda_" + cuda_version in result.stdout:
return "cu" + cuda_version.replace(".", "")

raise RuntimeError(f"Please install/reinstall CUDA tookit with any of the following supported version: {build_config.supported_cuda_versions}")

OS_TYPE = get_os_type()
PYTHON_VERSION = get_python_version()
CUDA_VERSION = get_cuda_version()
build_config.cuda_version = CUDA_VERSION
Expand All @@ -45,12 +54,7 @@ def get_platform_config_name():
platform_config_name = "_Wheels"

# Add OS Type
if platform.system() == 'Windows':
platform_config_name += "_win"
elif platform.system() == "Linux":
platform_config_name += "_linux"
else:
raise NotImplementedError(f"Platform {platform.system()} not supported!")
platform_config_name += "_" + OS_TYPE

# Add Python Version
platform_config_name += "_" + PYTHON_VERSION
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Redirect warnings to the logging system
logging.captureWarnings(True)

conf_path = os.path.join(ROOT_PATH, "configs/system.conf")
conf_path = os.path.join(ROOT_PATH, "Configs/system.conf")
# Configuration
f = open(conf_path)
conf_text = f.read()
Expand Down