Skip to content
Open
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: 2 additions & 0 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def summary(ecs_with_res):
def build_and_install_software(ecs, init_session_state, exit_on_failure=True, testing=False):
"""
Build and install software for all provided parsed easyconfig files.
The build environment is reset to the one passed by init_session_state between builds.
However, the environment is _not_ reset after the last build.

:param ecs: easyconfig files to install software with
:param init_session_state: initial session state, to use in test reports
Expand Down
13 changes: 8 additions & 5 deletions easybuild/tools/systemtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,12 @@ def get_isa_riscv():
return isa_string


def get_gpu_info():
def get_gpu_info(environment=None):
"""
Get the GPU info

:param environment: The environment to be used for determining GPU information.
By default, inherit the processes' environment.
"""
if get_os_type() != LINUX:
_log.info("Only know how to get GPU info on Linux, assuming no GPUs are present")
Expand All @@ -686,7 +689,7 @@ def get_gpu_info():
cmd = "nvidia-smi --query-gpu=gpu_name,driver_version --format=csv,noheader"
_log.debug("Trying to determine NVIDIA GPU info on Linux via cmd '%s'", cmd)
res = run_shell_cmd(cmd, fail_on_error=False, in_dry_run=True, hidden=True, with_hooks=False,
output_file=False, stream_output=False)
output_file=False, stream_output=False, env=environment)
if res.exit_code == EasyBuildExit.SUCCESS:
for line in res.output.strip().split('\n'):
nvidia_gpu_info = gpu_info.setdefault('NVIDIA', {})
Expand All @@ -706,7 +709,7 @@ def get_gpu_info():
cmd = "amd-smi static --driver --board --asic --csv"
_log.debug("Trying to determine AMD GPU info on Linux via cmd '%s'", cmd)
res = run_shell_cmd(cmd, fail_on_error=False, in_dry_run=True, hidden=True, with_hooks=False,
output_file=False, stream_output=False, split_stderr=True)
output_file=False, stream_output=False, split_stderr=True, env=environment)
if res.exit_code == EasyBuildExit.SUCCESS:
csv_reader = csv.DictReader(io.StringIO(res.output.strip()))

Expand Down Expand Up @@ -737,14 +740,14 @@ def get_gpu_info():
cmd = "rocm-smi --showdriverversion --csv"
_log.debug("Trying to determine AMD GPU driver on Linux via cmd '%s'", cmd)
res = run_shell_cmd(cmd, fail_on_error=False, in_dry_run=True, hidden=True, with_hooks=False,
output_file=False, stream_output=False, split_stderr=True)
output_file=False, stream_output=False, split_stderr=True, env=environment)
if res.exit_code == EasyBuildExit.SUCCESS:
amd_driver = res.output.strip().split('\n')[1].split(',')[1]

cmd = "rocm-smi --showproductname --csv"
_log.debug("Trying to determine AMD GPU info on Linux via cmd '%s'", cmd)
res = run_shell_cmd(cmd, fail_on_error=False, in_dry_run=True, hidden=True, with_hooks=False,
output_file=False, stream_output=False, split_stderr=True)
output_file=False, stream_output=False, split_stderr=True, env=environment)
if res.exit_code == EasyBuildExit.SUCCESS:
for line in res.output.strip().split('\n')[1:]:
amd_card_series = line.split(',')[1]
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def post_pr_test_report(pr_nrs, repo_type, test_report, msg, init_session_state,
system_info['cpu_model'] += " (%s)" % system_info['cpu_arch_name']

# add GPU info, if known
gpu_info = get_gpu_info()
gpu_info = get_gpu_info(init_session_state['environment'])
gpu_str = ""
if gpu_info:
for vendor, vendor_gpu in gpu_info.items():
Expand Down