Skip to content

Commit 1c6e560

Browse files
authored
core replace x86cpu with py cpuinfo (#18151)
test=develop
1 parent 23f8a4b commit 1c6e560

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
9292
# specify sphinx version as 1.5.6 and remove -U option for [pip install -U
9393
# sphinx-rtd-theme] since -U option will cause sphinx being updated to newest
9494
# version(1.7.1 for now), which causes building documentation failed.
95-
RUN pip3 --no-cache-dir install -U wheel x86cpu==0.4 && \
95+
RUN pip3 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
9696
pip3 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
9797
pip3 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
98-
pip3.6 --no-cache-dir install -U wheel x86cpu==0.4 && \
98+
pip3.6 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
9999
pip3.6 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
100100
pip3.6 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
101-
pip3.7 --no-cache-dir install -U wheel x86cpu==0.4 && \
101+
pip3.7 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
102102
pip3.7 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
103103
pip3.7 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
104104
easy_install -U pip && \
105-
pip --no-cache-dir install -U pip setuptools wheel x86cpu==0.4 && \
105+
pip --no-cache-dir install -U pip setuptools wheel py-cpuinfo==5.0.0 && \
106106
pip --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
107107
pip --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark
108108

paddle/scripts/Dockerfile.tmp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
9292
# specify sphinx version as 1.5.6 and remove -U option for [pip install -U
9393
# sphinx-rtd-theme] since -U option will cause sphinx being updated to newest
9494
# version(1.7.1 for now), which causes building documentation failed.
95-
RUN pip3 --no-cache-dir install -U wheel x86cpu==0.4 && \
95+
RUN pip3 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
9696
pip3 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
9797
pip3 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
98-
pip3.6 --no-cache-dir install -U wheel x86cpu==0.4 && \
98+
pip3.6 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
9999
pip3.6 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
100100
pip3.6 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
101-
pip3.7 --no-cache-dir install -U wheel x86cpu==0.4 && \
101+
pip3.7 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \
102102
pip3.7 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
103103
pip3.7 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \
104104
easy_install -U pip && \
105-
pip --no-cache-dir install -U pip setuptools wheel x86cpu==0.4 && \
105+
pip --no-cache-dir install -U pip setuptools wheel py-cpuinfo==5.0.0 && \
106106
pip --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \
107107
pip --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark
108108

paddle/scripts/paddle_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ EOF
840840
# run paddle version to install python packages first
841841
RUN apt-get update && ${NCCL_DEPS}
842842
RUN apt-get install -y wget python3 python3-pip libgtk2.0-dev dmidecode python3-tk && \
843-
pip3 install opencv-python x86cpu==0.4 && pip3 install /*.whl; apt-get install -f -y && \
843+
pip3 install opencv-python py-cpuinfo==5.0.0 && pip3 install /*.whl; apt-get install -f -y && \
844844
apt-get clean -y && \
845845
rm -f /*.whl && \
846846
${PADDLE_VERSION} && \

python/paddle/fluid/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import sys
1818
import os
19-
from x86cpu import info as cpuinfo
19+
from cpuinfo import get_cpu_info
2020

2121
try:
2222
if os.name == 'nt':
@@ -45,7 +45,7 @@
4545
raise e
4646

4747
load_noavx = False
48-
if cpuinfo.supports_avx:
48+
if 'avx' in get_cpu_info()['flags']:
4949
try:
5050
from .core_avx import *
5151
from .core_avx import __doc__, __file__, __name__, __package__

python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ funcsigs
1616
pyyaml
1717
decorator
1818
prettytable
19-
x86cpu==0.4
19+
py-cpuinfo==5.0.0

0 commit comments

Comments
 (0)