Skip to content

Commit 8a92b39

Browse files
mroddenRuturaj4
authored andcommitted
Sync get-rocm script
Fixes issue with ROCm versions and EL repo formats (cherry picked from commit f67b32d)
1 parent 1f0e2dc commit 8a92b39

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/rocm/tools/get_rocm.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@ def setup_repos_ubuntu(rocm_version_str):
272272
if rv.rev == 0:
273273
rocm_version_str = "%d.%d" % (rv.major, rv.minor)
274274

275-
# Update indexes.
275+
# update indexes before prereq install, for fresh docker images
276276
subprocess.check_call(["apt-get", "update"])
277+
277278
s = get_system()
278279
s.install_packages(["wget", "sudo", "gnupg"])
279280

@@ -300,12 +301,18 @@ def setup_repos_ubuntu(rocm_version_str):
300301
with open("/etc/apt/preferences.d/rocm-pin-600", "w") as fd:
301302
fd.write(APT_RADEON_PIN_CONTENT)
302303

303-
# update indexes
304+
# update indexes after new repo install
304305
subprocess.check_call(["apt-get", "update"])
305306

306307

307308
def setup_repos_el8(rocm_version_str):
308309

310+
rv = parse_version(rocm_version_str)
311+
312+
# if X.Y.0 -> repo url version should be X.Y
313+
if rv.rev == 0:
314+
rocm_version_str = "%d.%d" % (rv.major, rv.minor)
315+
309316
with open("/etc/yum.repos.d/rocm.repo", "w") as rfd:
310317
rfd.write(
311318
"""

0 commit comments

Comments
 (0)