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

Update setup.py

parent 7e12e0ed
......@@ -139,27 +139,17 @@ def get_abi():
except Exception:
return 'abiUnknown'
dcu_version = __version__
dcu_version += '+das1.1'
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()
dcu_version += '+das'
if os.getenv("ROCM_PATH"):
rocm_path = os.getenv('ROCM_PATH', "")
rocm_version_path = os.path.join(rocm_path, '.info', "rocm_version")
with open(rocm_version_path, 'r',encoding='utf-8') as file:
lines = file.readlines()
rocm_version=lines[0][:-2].replace(".", "")
dcu_version += ".dtk" + rocm_version
# torch version
import torch
dcu_version += ".torch" + torch.__version__[:]
with open(rocm_version_path, 'r') as file:
content = file.read().strip()
dtk_version = content.replace('.', '')
dcu_version += ".dtk" + dtk_version
def write_version_file():
cwd = os.path.dirname(os.path.abspath(__file__))
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