ROCm / rocprofiler-compute

Advanced Profiling and Analytics for AMD Hardware
https://rocm.docs.amd.com/projects/omniperf/en/latest/
MIT License
135 stars 49 forks source link

Python error when running omniperf profile (UnicodeDecodeError) #250

Closed benrichard-amd closed 8 months ago

benrichard-amd commented 8 months ago

Describe the bug omniperf profile crashes with Python error: UnicodeDecodeError

Development Environment:

To Reproduce

Run omniperf profile, for example:

omniperf profile --name gemm_test -- ./gemm

Output:

Resolving rocprof
ROC Profiler:  /opt/rocm-6.0.0/bin/rocprof
Traceback (most recent call last):
  File "./omniperf/bin/omniperf", line 889, in <module>
    main()
  File "./omniperf/bin/omniperf", line 738, in main
    args.target = get_soc()
  File "./omniperf/bin/omniperf", line 109, in get_soc
    mspec = specs.get_machine_specs(0)
  File "/home/user/omniperf/bin/utils/specs.py", line 220, in get_machine_specs
    rocm_smi = run(["rocm-smi"])
  File "/home/user/omniperf/bin/utils/specs.py", line 154, in run
    return p.stdout.decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 599: ordinal not in range(128)

Expected behavior Profiling happens successfully

Additional context Changing "ascii" to "utf-8" on that line seems to avoid the issue.

coleramos425 commented 8 months ago

Thanks for the report @benrichard-amd . The issue has been patched (here https://github.com/AMDResearch/omniperf/commit/d9a6832e3063c61f8866d380546a82fe8fe7914f ) and will be included in the upcoming release.