DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] compile dpdk with no avx
@ 2014-11-12 12:45 Yaron Illouz
  2014-11-12 13:48 ` Masaru Oki
  0 siblings, 1 reply; 6+ messages in thread
From: Yaron Illouz @ 2014-11-12 12:45 UTC (permalink / raw)
  To: dev

Hi 

 

I use dpdk in my product. I can't change my dpdk version.

I compile it on a server that have avx.

Most of the time, it run on machine that have avx, but not always.

 

When running the product on a machine with no avx, it crash on illegal
instruction.

The current solution is to build it on a computer with no avx.

 

Is there a compilation flag to disable avx? So it doesn't matter on
which computer I compiled it.

 

Compile flag

defconfig_x86_64-default-linuxapp-gcc

 

Dpdk version

PACKAGE_VERSION_MAJOR_NUMBER=1

PACKAGE_VERSION_MINOR_NUMBER=6

PACKAGE_VERSION_PATCH_NUMBER=0

PACKAGE_VERSION_BUILD_NUMBER=18

 

Gcc version

gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)

 

OS

CentOS release 6.3 (Final)

 

 

 

 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] compile dpdk with no avx
  2014-11-12 12:45 [dpdk-dev] compile dpdk with no avx Yaron Illouz
@ 2014-11-12 13:48 ` Masaru Oki
  2014-11-12 14:24   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 6+ messages in thread
From: Masaru Oki @ 2014-11-12 13:48 UTC (permalink / raw)
  To: Yaron Illouz; +Cc: <dev

Hi,

Some libraries need AVX instruction, but if you don't use, it can disable.
  e.g. CONFIG_RTE_LIBRTE_IXGBE_PMD=n in config file.


2014-11-12 21:45 GMT+09:00 Yaron Illouz <yaroni@radcom.com>:
> Hi
>
>
>
> I use dpdk in my product. I can't change my dpdk version.
>
> I compile it on a server that have avx.
>
> Most of the time, it run on machine that have avx, but not always.
>
>
>
> When running the product on a machine with no avx, it crash on illegal
> instruction.
>
> The current solution is to build it on a computer with no avx.
>
>
>
> Is there a compilation flag to disable avx? So it doesn't matter on
> which computer I compiled it.
>
>
>
> Compile flag
>
> defconfig_x86_64-default-linuxapp-gcc
>
>
>
> Dpdk version
>
> PACKAGE_VERSION_MAJOR_NUMBER=1
>
> PACKAGE_VERSION_MINOR_NUMBER=6
>
> PACKAGE_VERSION_PATCH_NUMBER=0
>
> PACKAGE_VERSION_BUILD_NUMBER=18
>
>
>
> Gcc version
>
> gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
>
>
>
> OS
>
> CentOS release 6.3 (Final)
>
>
>
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] compile dpdk with no avx
  2014-11-12 13:48 ` Masaru Oki
@ 2014-11-12 14:24   ` De Lara Guarch, Pablo
  2014-11-12 15:23     ` Neil Horman
  0 siblings, 1 reply; 6+ messages in thread
From: De Lara Guarch, Pablo @ 2014-11-12 14:24 UTC (permalink / raw)
  To: Masaru Oki, Yaron Illouz; +Cc: <dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Masaru Oki
> Sent: Wednesday, November 12, 2014 1:48 PM
> To: Yaron Illouz
> Cc: <dev@dpdk.org>
> Subject: Re: [dpdk-dev] compile dpdk with no avx
> 
> Hi,
> 
> Some libraries need AVX instruction, but if you don't use, it can disable.
>   e.g. CONFIG_RTE_LIBRTE_IXGBE_PMD=n in config file.
> 
> 
> 2014-11-12 21:45 GMT+09:00 Yaron Illouz <yaroni@radcom.com>:
> > Hi
> >
> >
> >
> > I use dpdk in my product. I can't change my dpdk version.
> >
> > I compile it on a server that have avx.
> >
> > Most of the time, it run on machine that have avx, but not always.
> >
> >
> >
> > When running the product on a machine with no avx, it crash on illegal
> > instruction.
> >
> > The current solution is to build it on a computer with no avx.
> >
> >
> >
> > Is there a compilation flag to disable avx? So it doesn't matter on
> > which computer I compiled it.

Basically, you are looking at cross-compiling DPDK. One thing you could do
 is go to one of the config files (i.e. defconfig_x86-64-native-linuxapp-gcc) 
and change CONFIG_RTE_MACHINE, from "native" to one of the
 micro-architectures that do not have avx, such as "wsm" (Westmere).

Regards,
Pablo

> >
> >
> >
> > Compile flag
> >
> > defconfig_x86_64-default-linuxapp-gcc
> >
> >
> >
> > Dpdk version
> >
> > PACKAGE_VERSION_MAJOR_NUMBER=1
> >
> > PACKAGE_VERSION_MINOR_NUMBER=6
> >
> > PACKAGE_VERSION_PATCH_NUMBER=0
> >
> > PACKAGE_VERSION_BUILD_NUMBER=18
> >
> >
> >
> > Gcc version
> >
> > gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> >
> >
> >
> > OS
> >
> > CentOS release 6.3 (Final)
> >
> >
> >
> >
> >
> >
> >
> >
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] compile dpdk with no avx
  2014-11-12 14:24   ` De Lara Guarch, Pablo
@ 2014-11-12 15:23     ` Neil Horman
  2014-11-12 16:16       ` Bruce Richardson
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Horman @ 2014-11-12 15:23 UTC (permalink / raw)
  To: De Lara Guarch, Pablo; +Cc: <dev

On Wed, Nov 12, 2014 at 02:24:10PM +0000, De Lara Guarch, Pablo wrote:
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Masaru Oki
> > Sent: Wednesday, November 12, 2014 1:48 PM
> > To: Yaron Illouz
> > Cc: <dev@dpdk.org>
> > Subject: Re: [dpdk-dev] compile dpdk with no avx
> > 
> > Hi,
> > 
> > Some libraries need AVX instruction, but if you don't use, it can disable.
> >   e.g. CONFIG_RTE_LIBRTE_IXGBE_PMD=n in config file.
> > 
> > 
> > 2014-11-12 21:45 GMT+09:00 Yaron Illouz <yaroni@radcom.com>:
> > > Hi
> > >
> > >
> > >
> > > I use dpdk in my product. I can't change my dpdk version.
> > >
> > > I compile it on a server that have avx.
> > >
> > > Most of the time, it run on machine that have avx, but not always.
> > >
> > >
> > >
> > > When running the product on a machine with no avx, it crash on illegal
> > > instruction.
> > >
> > > The current solution is to build it on a computer with no avx.
> > >
> > >
> > >
> > > Is there a compilation flag to disable avx? So it doesn't matter on
> > > which computer I compiled it.
> 
> Basically, you are looking at cross-compiling DPDK. One thing you could do
>  is go to one of the config files (i.e. defconfig_x86-64-native-linuxapp-gcc) 
> and change CONFIG_RTE_MACHINE, from "native" to one of the
>  micro-architectures that do not have avx, such as "wsm" (Westmere).
> 
What version of dpdk are you running?  We fixed this a while ago with
commits 8777aabc538fdac24457958eaab929f33d6c4cdf and
074f54ad03ee0c84dcae235933e2b426208fe591.  They do runtime checking for
availability of the AVX and SSE3 instructions and only exeucte paths using those
instructions if the running cpu supports them.  Note that you are still required
to build for the default arch.
Neil

> Regards,
> Pablo
> 
> > >
> > >
> > >
> > > Compile flag
> > >
> > > defconfig_x86_64-default-linuxapp-gcc
> > >
> > >
> > >
> > > Dpdk version
> > >
> > > PACKAGE_VERSION_MAJOR_NUMBER=1
> > >
> > > PACKAGE_VERSION_MINOR_NUMBER=6
> > >
> > > PACKAGE_VERSION_PATCH_NUMBER=0
> > >
> > > PACKAGE_VERSION_BUILD_NUMBER=18
> > >
> > >
> > >
> > > Gcc version
> > >
> > > gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> > >
> > >
> > >
> > > OS
> > >
> > > CentOS release 6.3 (Final)
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] compile dpdk with no avx
  2014-11-12 15:23     ` Neil Horman
@ 2014-11-12 16:16       ` Bruce Richardson
  2014-11-12 19:30         ` Neil Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2014-11-12 16:16 UTC (permalink / raw)
  To: Neil Horman; +Cc: <dev

On Wed, Nov 12, 2014 at 10:23:49AM -0500, Neil Horman wrote:
> On Wed, Nov 12, 2014 at 02:24:10PM +0000, De Lara Guarch, Pablo wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Masaru Oki
> > > Sent: Wednesday, November 12, 2014 1:48 PM
> > > To: Yaron Illouz
> > > Cc: <dev@dpdk.org>
> > > Subject: Re: [dpdk-dev] compile dpdk with no avx
> > > 
> > > Hi,
> > > 
> > > Some libraries need AVX instruction, but if you don't use, it can disable.
> > >   e.g. CONFIG_RTE_LIBRTE_IXGBE_PMD=n in config file.
> > > 
> > > 
> > > 2014-11-12 21:45 GMT+09:00 Yaron Illouz <yaroni@radcom.com>:
> > > > Hi
> > > >
> > > >
> > > >
> > > > I use dpdk in my product. I can't change my dpdk version.
> > > >
> > > > I compile it on a server that have avx.
> > > >
> > > > Most of the time, it run on machine that have avx, but not always.
> > > >
> > > >
> > > >
> > > > When running the product on a machine with no avx, it crash on illegal
> > > > instruction.
> > > >
> > > > The current solution is to build it on a computer with no avx.
> > > >
> > > >
> > > >
> > > > Is there a compilation flag to disable avx? So it doesn't matter on
> > > > which computer I compiled it.
> > 
> > Basically, you are looking at cross-compiling DPDK. One thing you could do
> >  is go to one of the config files (i.e. defconfig_x86-64-native-linuxapp-gcc) 
> > and change CONFIG_RTE_MACHINE, from "native" to one of the
> >  micro-architectures that do not have avx, such as "wsm" (Westmere).
> > 
> What version of dpdk are you running?  We fixed this a while ago with
> commits 8777aabc538fdac24457958eaab929f33d6c4cdf and
> 074f54ad03ee0c84dcae235933e2b426208fe591.  They do runtime checking for
> availability of the AVX and SSE3 instructions and only exeucte paths using those
> instructions if the running cpu supports them.  Note that you are still required
> to build for the default arch.
> Neil
> 

Hi Neil,

those commits only fix the cases where we compile the code generically, and have
specific runtime code paths. However, when compiling for a native target the
compiler will freely use AVX instructions when it feels it will lead to faster
code. There is no run-time checking we can do to avoid this, hence the need
for changing the build-time configuration.

/Bruce

> > Regards,
> > Pablo
> > 
> > > >
> > > >
> > > >
> > > > Compile flag
> > > >
> > > > defconfig_x86_64-default-linuxapp-gcc
> > > >
> > > >
> > > >
> > > > Dpdk version
> > > >
> > > > PACKAGE_VERSION_MAJOR_NUMBER=1
> > > >
> > > > PACKAGE_VERSION_MINOR_NUMBER=6
> > > >
> > > > PACKAGE_VERSION_PATCH_NUMBER=0
> > > >
> > > > PACKAGE_VERSION_BUILD_NUMBER=18
> > > >
> > > >
> > > >
> > > > Gcc version
> > > >
> > > > gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> > > >
> > > >
> > > >
> > > > OS
> > > >
> > > > CentOS release 6.3 (Final)
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] compile dpdk with no avx
  2014-11-12 16:16       ` Bruce Richardson
@ 2014-11-12 19:30         ` Neil Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Horman @ 2014-11-12 19:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: <dev

On Wed, Nov 12, 2014 at 04:16:12PM +0000, Bruce Richardson wrote:
> On Wed, Nov 12, 2014 at 10:23:49AM -0500, Neil Horman wrote:
> > On Wed, Nov 12, 2014 at 02:24:10PM +0000, De Lara Guarch, Pablo wrote:
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Masaru Oki
> > > > Sent: Wednesday, November 12, 2014 1:48 PM
> > > > To: Yaron Illouz
> > > > Cc: <dev@dpdk.org>
> > > > Subject: Re: [dpdk-dev] compile dpdk with no avx
> > > > 
> > > > Hi,
> > > > 
> > > > Some libraries need AVX instruction, but if you don't use, it can disable.
> > > >   e.g. CONFIG_RTE_LIBRTE_IXGBE_PMD=n in config file.
> > > > 
> > > > 
> > > > 2014-11-12 21:45 GMT+09:00 Yaron Illouz <yaroni@radcom.com>:
> > > > > Hi
> > > > >
> > > > >
> > > > >
> > > > > I use dpdk in my product. I can't change my dpdk version.
> > > > >
> > > > > I compile it on a server that have avx.
> > > > >
> > > > > Most of the time, it run on machine that have avx, but not always.
> > > > >
> > > > >
> > > > >
> > > > > When running the product on a machine with no avx, it crash on illegal
> > > > > instruction.
> > > > >
> > > > > The current solution is to build it on a computer with no avx.
> > > > >
> > > > >
> > > > >
> > > > > Is there a compilation flag to disable avx? So it doesn't matter on
> > > > > which computer I compiled it.
> > > 
> > > Basically, you are looking at cross-compiling DPDK. One thing you could do
> > >  is go to one of the config files (i.e. defconfig_x86-64-native-linuxapp-gcc) 
> > > and change CONFIG_RTE_MACHINE, from "native" to one of the
> > >  micro-architectures that do not have avx, such as "wsm" (Westmere).
> > > 
> > What version of dpdk are you running?  We fixed this a while ago with
> > commits 8777aabc538fdac24457958eaab929f33d6c4cdf and
> > 074f54ad03ee0c84dcae235933e2b426208fe591.  They do runtime checking for
> > availability of the AVX and SSE3 instructions and only exeucte paths using those
> > instructions if the running cpu supports them.  Note that you are still required
> > to build for the default arch.
> > Neil
> > 
> 
> Hi Neil,
> 
> those commits only fix the cases where we compile the code generically, and have
> specific runtime code paths. However, when compiling for a native target the
> compiler will freely use AVX instructions when it feels it will lead to faster
> code. There is no run-time checking we can do to avoid this, hence the need
> for changing the build-time configuration.
> 
Yes, please see the last sentence in my post.
Neil

> /Bruce
> 
> > > Regards,
> > > Pablo
> > > 
> > > > >
> > > > >
> > > > >
> > > > > Compile flag
> > > > >
> > > > > defconfig_x86_64-default-linuxapp-gcc
> > > > >
> > > > >
> > > > >
> > > > > Dpdk version
> > > > >
> > > > > PACKAGE_VERSION_MAJOR_NUMBER=1
> > > > >
> > > > > PACKAGE_VERSION_MINOR_NUMBER=6
> > > > >
> > > > > PACKAGE_VERSION_PATCH_NUMBER=0
> > > > >
> > > > > PACKAGE_VERSION_BUILD_NUMBER=18
> > > > >
> > > > >
> > > > >
> > > > > Gcc version
> > > > >
> > > > > gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> > > > >
> > > > >
> > > > >
> > > > > OS
> > > > >
> > > > > CentOS release 6.3 (Final)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-12 19:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-12 12:45 [dpdk-dev] compile dpdk with no avx Yaron Illouz
2014-11-12 13:48 ` Masaru Oki
2014-11-12 14:24   ` De Lara Guarch, Pablo
2014-11-12 15:23     ` Neil Horman
2014-11-12 16:16       ` Bruce Richardson
2014-11-12 19:30         ` Neil Horman

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git