Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocprof bash sets PATH to the wrong location, then fails to find rocminfo #143

Open
JonChesterfield opened this issue Jul 10, 2024 · 1 comment

Comments

@JonChesterfield
Copy link

Problem Description

The rocprof bash script installed under bin/rocprof sets path to export PATH=.:$PATH. I think this is intended to put the current directory on the path such that things like rocminfo can be found next to rocprof. That only works when running rocprof from the current directory.

/bin/sh: 1: rocminfo: not found
Traceback (most recent call last):
  File "/home/amd/rocm/aomp_19.0-2/libexec/rocprofiler/tblextr.py", line 1113, in <module>
    metadata_gen(sysinfo_file, "rocminfo")
  File "/home/amd/rocm/aomp_19.0-2/libexec/rocprofiler/tblextr.py", line 124, in metadata_gen
    raise Exception('Could not run command: "' + sysinfo_cmd + '"')
Exception: Could not run command: "rocminfo"

If this is changed to something like export PATH=$BIN_DIR:$PATH then rocprof successfully finds rocminfo.

Related, there's a error message that is intended to print when rocminfo is not found, instead of the above trace:

if !command -v rocminfo > /dev/null 2>&1 ;  then
  error "'rocminfo' utility is not found: please add ROCM bin path to PATH env var.";
fi

I don't believe that works as intended, adding parens would be one way to retrieve the nicer message

if !(command -v rocminfo > /dev/null 2>&1) ;  then
  error "'rocminfo' utility is not found: please add ROCM bin path to PATH env var.";
fi

Operating System

Ubuntu

CPU

2990WX

GPU

AMD Radeon VII

ROCm Version

ROCm 6.1.0

ROCm Component

rocprofiler

Steps to Reproduce

Change to a directory other than the one containing rocprof. Run rocprof. Note the stack trace from python.

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

@harkgill-amd
Copy link

harkgill-amd commented Aug 21, 2024

Hi @JonChesterfield, are you still experiencing this issue with ROCm 6.2.0? I was not able to reproduce this following the steps you provided. From my understanding, when calling rocminfo or rocprof, the executable/script are found under /usr/bin which should be under your PATH. These files are symbolically linked to those found in /opt/rocm-6.2.0/bin and you should be able to call them regardless of which directory you are in.

export PATH=.:$PATH simply appends the current directory to PATH, the existing directories on PATH will still be checked, in this case /usr/bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants