Search code examples
cmemory-leaksvalgrinddpdk

Error when running DPDK app on valgrind


When I run my DPDK based app on valgrind, it cannot execute it and throws error

ERROR: This system does not support "RDRAND". Please check that RTE_MACHINE is set correctly.

My CPU supports RDRAND, still it is throwing the same error. For valgrind to support hugepages which are being used by my app, I'm using the following patched version of valgrind. https://github.com/bisdn/valgrind-hugepages.git


Solution

  • I had this same problem on a Haswell architecture CPU, and was able to fix it by modifying one of the makefiles to remove a handful of options. Specifically, AVX/AVX2, RDRND, FSGSBASE, and F16C. You might need to remove other options that valgrind is balking at and recompile DPDK, it was an iterative process for me. There's probably a more elegant way to do this using the .config file but I didn't find it. See this patch:

    diff -u dpdk-2.2.0-orig/mk/rte.cpuflags.mk dpdk-2.2.0/mk/rte.cpuflags.mk
    --- dpdk-2.2.0-orig/mk/rte.cpuflags.mk^I2015-12-15 12:06:58.000000000 -0500
    +++ dpdk-2.2.0/mk/rte.cpuflags.mk^I2016-08-24 08:53:22.911258783 -0400
    @@ -69,26 +69,6 @@
     CPUFLAGS += PCLMULQDQ
     endif
    
    -ifneq ($(filter $(AUTO_CPUFLAGS),__AVX__),)
    -CPUFLAGS += AVX
    -endif
    -
    -ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
    -CPUFLAGS += RDRAND
    -endif
    -
    -ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
    -CPUFLAGS += FSGSBASE
    -endif
    -
    -ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
    -CPUFLAGS += F16C
    -endif
    -
    -ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
    -CPUFLAGS += AVX2
    -endif
    -
     # IBM Power CPU flags
     ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),)
     CPUFLAGS += PPC64