Unverified Commit 8aa68ed5 authored by kk's avatar kk Committed by GitHub
Browse files

Solve docker build failed in the virtual machine (#7290)


Co-authored-by: default avatarwunhuang <wunhuang@amd.com>
Co-authored-by: default avatarSai Enduri <saimanas.enduri@amd.com>
Co-authored-by: default avatarHAI <hixiao@gmail.com>
parent 506c4928
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
# ============================================================================== # ==============================================================================
import os
import platform import platform
import sys import sys
from pathlib import Path from pathlib import Path
...@@ -50,7 +51,17 @@ cxx_flags = ["-O3"] ...@@ -50,7 +51,17 @@ cxx_flags = ["-O3"]
libraries = ["hiprtc", "amdhip64", "c10", "torch", "torch_python"] libraries = ["hiprtc", "amdhip64", "c10", "torch", "torch_python"]
extra_link_args = ["-Wl,-rpath,$ORIGIN/../../torch/lib", f"-L/usr/lib/{arch}-linux-gnu"] extra_link_args = ["-Wl,-rpath,$ORIGIN/../../torch/lib", f"-L/usr/lib/{arch}-linux-gnu"]
amdgpu_target = torch.cuda.get_device_properties("cuda").gcnArchName.split(":")[0] default_target = "gfx942"
amdgpu_target = os.environ.get("AMDGPU_TARGET", default_target)
if torch.cuda.is_available():
try:
amdgpu_target = torch.cuda.get_device_properties(0).gcnArchName.split(":")[0]
except Exception as e:
print(f"Warning: Failed to detect GPU properties: {e}")
else:
print(f"Warning: torch.cuda not available. Using default target: {amdgpu_target}")
if amdgpu_target not in ["gfx942", "gfx950"]: if amdgpu_target not in ["gfx942", "gfx950"]:
print( print(
f"Warning: Unsupported GPU architecture detected '{amdgpu_target}'. Expected 'gfx942' or 'gfx950'." f"Warning: Unsupported GPU architecture detected '{amdgpu_target}'. Expected 'gfx942' or 'gfx950'."
......
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