test: test查看cpu指令集
This commit is contained in:
@@ -15,7 +15,8 @@ RUN apt-get update && apt-get install -y build-essential
|
|||||||
|
|
||||||
# test
|
# test
|
||||||
RUN cat /proc/cpuinfo
|
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
|
RUN uv pip install --system --upgrade pip
|
||||||
|
|||||||
5
test_cpu.py
Normal file
5
test_cpu.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import cpuinfo
|
||||||
|
|
||||||
|
cpu_info = cpuinfo.get_cpu_info()
|
||||||
|
print(f"当前cpu信息:{cpu_info}")
|
||||||
|
print(f"当前cpu指令集支持:{cpu_info["flags"]}")
|
||||||
Reference in New Issue
Block a user