Check Python version on application launch (#393)
* Check that the minimum required Python (3.8) version is used. Prints a descriptive error message, rather than a cryptic import failure, if minimum Python version is not met. Internal ticket SWDEV-477233. * Disable the RPM mangling of shebangs. The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`. With this set, omniperf is always using the platform installed version of python, which is python 3.6 on RHEL 8. Using virtual environments, like conda, did not work. * Fix pylint issues --------- Signed-off-by: David Galiffi <David.Galiffi@amd.com>
此提交包含在:
@@ -32,7 +32,7 @@ right for you.
|
||||
:width: 800
|
||||
|
||||
.. _core-install:
|
||||
|
||||
|
||||
Core installation
|
||||
=================
|
||||
|
||||
@@ -44,6 +44,12 @@ installation.
|
||||
* CMake ``>= 3.19``
|
||||
* ROCm ``>= 5.7.1``
|
||||
|
||||
.. note::
|
||||
|
||||
Omniperf will use the first version of ``Python3`` found in your system's
|
||||
``PATH``. If the default version of Python3 is older than 3.8, you may need to
|
||||
update your system's ``PATH`` to point to a newer version of Python3.
|
||||
|
||||
Omniperf depends on a number of Python packages documented in the top-level
|
||||
``requirements.txt`` file. Install these *before* configuring Omniperf.
|
||||
|
||||
@@ -66,6 +72,16 @@ following steps illustrate how to install the necessary Python dependencies
|
||||
using `pip <https://packaging.python.org/en/latest/>`_ and Omniperf into a
|
||||
shared location controlled by the ``INSTALL_DIR`` environment variable.
|
||||
|
||||
.. tip::
|
||||
|
||||
To always run Omniperf with a particular version of python, you can create a
|
||||
bash alias. For example, to run Omniperf with Python 3.10, you can run the
|
||||
following command:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
alias omniperf-mypython="/usr/bin/python3.10 /opt/rocm/bin/omniperf"
|
||||
|
||||
.. _core-install-cmake-vars:
|
||||
|
||||
Configuration variables
|
||||
@@ -208,21 +224,21 @@ software stack.
|
||||
.. code-block:: shell
|
||||
|
||||
$ sudo apt install omniperf
|
||||
$ pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
$ python3 -m pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
|
||||
.. tab-item:: Red Hat Enterprise Linux
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ sudo dnf install omniperf
|
||||
$ pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
$ python3 -m pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
|
||||
.. tab-item:: SUSE Linux Enterprise Server
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ sudo zypper install omniperf
|
||||
$ pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
$ python3 -m pip install -r /opt/rocm/libexec/omniperf/requirements.txt
|
||||
|
||||
.. _core-install-rocprof-var:
|
||||
|
||||
|
||||
新增問題並參考
封鎖使用者