From c7aff644acde491e1428929d6980f1f8f8fec18b Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 04:01:57 +0800 Subject: [PATCH] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- test_cpu.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test_cpu.py diff --git a/Dockerfile b/Dockerfile index 6ef7070da..39df23381 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,8 @@ RUN apt-get update && apt-get install -y build-essential # test RUN cat /proc/cpuinfo -RUN cat /proc/cpuinfo | grep avx2 +RUN uv pip install --system py-cpuinfo +RUN python test_cpu.py # 安装依赖 RUN uv pip install --system --upgrade pip diff --git a/test_cpu.py b/test_cpu.py new file mode 100644 index 000000000..befb40ec5 --- /dev/null +++ b/test_cpu.py @@ -0,0 +1,5 @@ +import cpuinfo + +cpu_info = cpuinfo.get_cpu_info() +print(f"当前cpu信息:{cpu_info}") +print(f"当前cpu指令集支持:{cpu_info["flags"]}") \ No newline at end of file