如何判断Linux机器是否支持AVX/AVX2指令? [英] How to tell if a Linux machine supports AVX/AVX2 instructions?

查看:2435
本文介绍了如何判断Linux机器是否支持AVX/AVX2指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SUSE Linux Enterprise 10/11计算机上.我对运行Intel处理器的计算机场进行回归分析.我的某些测试失败,因为我的工具是使用需要AVX/AVX2指令支持的库构建的.我收到一个Illegal exception错误.

I'm on SUSE Linux Enterprise 10/11 machines. I launch my regressions to a farm of machines running Intel processors. Some of my tests fail because my tools are built using a library which requires AVX/AVX2 instruction support. I get an Illegal exception error.

在Linux中,可以使用任何命令来确定CPU代码/家族名称是什么?

In Linux, is there any commands I can use to determine what is the CPU code/family name?

我相信AVX和AVX2可以分别从Intel SandyBridge和Haswell家族获得.

I believe AVX and AVX2 are available onward from Intel SandyBridge and Haswell family, respectively.

推荐答案

在Linux(或UNIX机器)上,有关CPU的信息位于/proc/cpuinfo中.您可以手动或使用grep命令(grep flags /proc/cpuinfo)从那里提取信息.

On linux (or unix machines) the information about your cpu is in /proc/cpuinfo. You can extract information from there by hand, or with a grep command (grep flags /proc/cpuinfo).

大多数编译器也会自动定义__AVX2__,因此您也可以进行检查.

Also most compilers will automatically define __AVX2__ so you can check for that too.

这篇关于如何判断Linux机器是否支持AVX/AVX2指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆