diff --git a/Dockerfile b/Dockerfile index ba6560a9d78ce120a77f61b711c0e3a650a8048b..2cf185159478ff083c8a814f7666952d6d174f4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,17 +92,17 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8 # specify sphinx version as 1.5.6 and remove -U option for [pip install -U # sphinx-rtd-theme] since -U option will cause sphinx being updated to newest # version(1.7.1 for now), which causes building documentation failed. -RUN pip3 --no-cache-dir install -U wheel x86cpu==0.4 && \ +RUN pip3 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.6 --no-cache-dir install -U wheel x86cpu==0.4 && \ + pip3.6 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.6 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.6 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.7 --no-cache-dir install -U wheel x86cpu==0.4 && \ + pip3.7 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.7 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.7 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ easy_install -U pip && \ - pip --no-cache-dir install -U pip setuptools wheel x86cpu==0.4 && \ + pip --no-cache-dir install -U pip setuptools wheel py-cpuinfo==5.0.0 && \ pip --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark diff --git a/paddle/scripts/Dockerfile.tmp b/paddle/scripts/Dockerfile.tmp index d75d1552cacd6ad99a84907ae35acdb23c313e87..4783b62a44fc71434fa3909f4416f3ab5e693e54 100644 --- a/paddle/scripts/Dockerfile.tmp +++ b/paddle/scripts/Dockerfile.tmp @@ -92,17 +92,17 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8 # specify sphinx version as 1.5.6 and remove -U option for [pip install -U # sphinx-rtd-theme] since -U option will cause sphinx being updated to newest # version(1.7.1 for now), which causes building documentation failed. -RUN pip3 --no-cache-dir install -U wheel && \ +RUN pip3 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.6 --no-cache-dir install -U wheel && \ + pip3.6 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.6 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.6 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.7 --no-cache-dir install -U wheel && \ + pip3.7 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.7 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.7 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ easy_install -U pip && \ - pip --no-cache-dir install -U pip setuptools wheel && \ + pip --no-cache-dir install -U pip setuptools wheel py-cpuinfo==5.0.0 && \ pip --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 02f9d36975dddf1ac2e188c2a1891740119b66e0..e7674859c71b8d4c75c1ea83fb68698ac97bcaed 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -839,7 +839,7 @@ EOF # run paddle version to install python packages first RUN apt-get update && ${NCCL_DEPS} RUN apt-get install -y wget python3 python3-pip libgtk2.0-dev dmidecode python3-tk && \ - pip3 install opencv-python x86cpu==0.4 && pip3 install /*.whl; apt-get install -f -y && \ + pip3 install opencv-python py-cpuinfo==5.0.0 && pip3 install /*.whl; apt-get install -f -y && \ apt-get clean -y && \ rm -f /*.whl && \ ${PADDLE_VERSION} && \ diff --git a/python/paddle/fluid/core.py b/python/paddle/fluid/core.py index 1b2ce77014fa699ce47ce26e53583c92dc82a46e..80a14ca08d0b9a4410510291050f02b6cbb78c59 100644 --- a/python/paddle/fluid/core.py +++ b/python/paddle/fluid/core.py @@ -16,7 +16,7 @@ from __future__ import print_function import sys import os -from x86cpu import info as cpuinfo +from cpuinfo import get_cpu_info try: if os.name == 'nt': @@ -45,7 +45,7 @@ except Exception as e: raise e load_noavx = False -if cpuinfo.supports_avx: +if 'avx' in get_cpu_info()['flags']: try: from .core_avx import * from .core_avx import __doc__, __file__, __name__, __package__ @@ -59,10 +59,9 @@ if cpuinfo.supports_avx: from .core_avx import _set_fuse_parameter_memory_size from .core_avx import _is_dygraph_debug_enabled from .core_avx import _dygraph_debug_level - except ImportError as error: + except ImportError: sys.stderr.write( - error.__class__.__name__ + - ' WARNING: Error importing avx core. You may not build with AVX, ' + 'WARNING: Can not import avx core. You may not build with AVX, ' 'but AVX is supported on local machine, you could build paddle ' 'WITH_AVX=ON to get better performance. ') load_noavx = True diff --git a/python/requirements.txt b/python/requirements.txt index 5a3ea0b35f0e3b2ca35ada8b5407654433cc918b..f971587bd7c885b04538b08fc075c51e013c80db 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -16,4 +16,4 @@ funcsigs pyyaml decorator prettytable -x86cpu==0.4 +py-cpuinfo==5.0.0