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

investigate encoding failure #19

Closed koomie closed 3 weeks ago

koomie commented 1 year ago

Ran into this error during analyze example running on an older ubuntu 18.04 system system that had LANG=en_US by default.

--------
Analyze
--------

Created a Saved Analysis folder

--------------------------------------------------------------------------------
0. Top Stat
Traceback (most recent call last):
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf", line 624, in <module>
    main()
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf", line 604, in main
    omniperf_cli(args)
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf_cli/omniperf_cli.py", line 225, in omniperf_cli
    tty.show_all(
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf_cli/utils/tty.py", line 172, in show_all
    print(ss, file=output)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-107: ordinal not in range(256)

Updating to LANG=en_US.UTF-8 fixed the issue.

We presumably always want to use utf-8 coding....

coleramos425 commented 1 year ago

Simplest solution seems to be using Python's locale module, however, it's worth noting setlocal() only sets LANG for the current process...

ppanchad-amd commented 3 weeks ago

@koomie Closing ticket since issue is fixed. Thanks!