ROCm / rocprofiler-compute

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

ERROR Please ensure that the 'en_US.UTF-8' locale is available on your system. #485

Open BowenBao opened 6 days ago

BowenBao commented 6 days ago

Describe your question

Hit this error when using omniperf on official rocm/vllm docker.

  ERROR Please ensure that the 'en_US.UTF-8' locale is available on your system.
  ERROR unsupported locale setting

Not sure how to resolve this issue properly. But was able to hack around it by modifying /opt/rocm/libexec/omniperf/utils/utils.py to skip the setlocale call entirely. Everything works afterwards.

--- utils.py
+++ utils.py
@@ -647,6 +647,7 @@

 def set_locale_encoding():
+    return
     try:
         locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
     except locale.Error as error:

I'm not sure if this function call should be strictly required for using omniperf..

Additional context

No response

tcgu-amd commented 1 day ago

Hi @BowenBao, thanks for reaching out! I think you might be missing the locale in your docker. Can you run the following command insider your rocm/vllm docker container

sudo apt update && sudo install locales && sudo locale-gen en_US.UTF-8

then try the problematic python script again?

Please let me know if this works. Thanks!

BowenBao commented 17 hours ago

Hi @tcgu-amd thanks for advice. Yes running sudo apt update && sudo apt install locales && sudo locale-gen en_US.UTF-8 resolves the issue. Is it possible to relax this constraint though? It would be better UX imo if omniperf just works out of the box.

tcgu-amd commented 16 hours ago

Hey @BowenBao, I think this is a rather an unusual case, since the locale would usually be available on the system (it is commonly a part of the system installation process). Relying on a specific locale is pretty common to allow applications to determine the date, time, display, and keyboard to use. Given that configuring the locales is a fairly common practice and most systems should have it configured, I think it is fair the way Omniperf currently works. If the locale happens to not be available, it is probably a good idea to install the correct one anyways :)