Commit 863c03f2 authored by zhanggezhong's avatar zhanggezhong
Browse files

Update setup.py

parent 7e12e0ed
...@@ -139,27 +139,17 @@ def get_abi(): ...@@ -139,27 +139,17 @@ def get_abi():
except Exception: except Exception:
return 'abiUnknown' return 'abiUnknown'
dcu_version = __version__ dcu_version = __version__
dcu_version += '+das1.1' dcu_version += '+das'
sha = "Unknown"
cwd = os.path.dirname(os.path.abspath(__file__))
try:
sha = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=cwd).decode("ascii").strip()
except Exception:
pass
if sha != 'Unknown':
dcu_version += '.git' + sha[:7]
dcu_version += "." + get_abi()
if os.getenv("ROCM_PATH"): if os.getenv("ROCM_PATH"):
rocm_path = os.getenv('ROCM_PATH', "") rocm_path = os.getenv('ROCM_PATH', "")
rocm_version_path = os.path.join(rocm_path, '.info', "rocm_version") rocm_version_path = os.path.join(rocm_path, '.info', "rocm_version")
with open(rocm_version_path, 'r',encoding='utf-8') as file: with open(rocm_version_path, 'r') as file:
lines = file.readlines() content = file.read().strip()
rocm_version=lines[0][:-2].replace(".", "") dtk_version = content.replace('.', '')
dcu_version += ".dtk" + rocm_version
# torch version dcu_version += ".dtk" + dtk_version
import torch
dcu_version += ".torch" + torch.__version__[:]
def write_version_file(): def write_version_file():
cwd = os.path.dirname(os.path.abspath(__file__)) cwd = os.path.dirname(os.path.abspath(__file__))
version_path = os.path.join(cwd, "pytorch3d", "__init__.py") version_path = os.path.join(cwd, "pytorch3d", "__init__.py")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment