diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 88f9a3bb8e72fa071440599b044cec6f9f8a3cf2..90db856c50671e17482de0e7c51c966934f10fab 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -301,7 +301,8 @@ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
 else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
   if(EXISTS  "/proc/cpuinfo")
     file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
-    if (CPUINFO MATCHES "avx512bw")
+    message("NOAVX512 is ${NOAVX512}")
+    if (CPUINFO MATCHES "avx512bw" AND "${NOAVX512}" STREQUAL "False")
       set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx512bw -march=skylake-avx512 -mtune=skylake-avx512 " )
       set(COMPILATION_AVX2 "True")
     else()
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index b427b161e584365149c72593f79fce80e9ac5794..2ef0c3121045e195ecbeea06004344f2c7f28cd0 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -62,6 +62,7 @@ CMAKE_CMD="$CMAKE"
 UE_AUTOTEST_TRACE="False"
 UE_DEBUG_TRACE="False"
 UE_TIMING_TRACE="False"
+NOAVX512="False"
 USRP_REC_PLAY="False"
 BUILD_ECLIPSE=0
 NR="False"
@@ -161,6 +162,8 @@ Options
    Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
 --usrp-recplay
    Build for I/Q record-playback modes
+--noavx512
+   Build without AVX512 if it is present on CPU
 -k | --skip-shared-libraries
    Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
 --ittiSIM
@@ -417,6 +420,10 @@ function main() {
             USRP_REC_PLAY="True"
             echo_info "Enabling USRP record playback mode"
             shift 1;;
+        --noavx512)
+            NOAVX512="True"
+            echo_info "Disabling AVX512"
+            shift 1;;
         -k | --skip-shared-libraries)
             SKIP_SHARED_LIB_FLAG="True"
             echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries"
@@ -614,6 +621,7 @@ function main() {
     echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )"                         >> $cmake_file
     echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )"                       >> $cmake_file
     echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )"                           >> $cmake_file
+    echo "set ( NOAVX512 $NOAVX512 )"                                     >> $cmake_file
     echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )"             >> $cmake_file
     echo "set ( ITTI_SIM $ITTI_SIM )"                                     >> $cmake_file
     echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )"                     >> $cmake_file
diff --git a/cmake_targets/phy_simulators/CMakeLists.txt b/cmake_targets/phy_simulators/CMakeLists.txt
index f8c659959f36a6558a2cf76f3c8a6ac1676a9be0..b3e4267060482c1473422297fc329985d88d8b87 100755
--- a/cmake_targets/phy_simulators/CMakeLists.txt
+++ b/cmake_targets/phy_simulators/CMakeLists.txt
@@ -15,6 +15,7 @@ set ( UE_AUTOTEST_TRACE False )
 set ( UE_DEBUG_TRACE False )
 set ( UE_TIMING_TRACE False )
 set ( USRP_REC_PLAY False )
+set ( NOAVX512 True )
 set ( SKIP_SHARED_LIB_FLAG False )
 set ( PHYSIM True)
 set ( RU 0)
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index 97c753d4551392774d39b804b4611d2d0d5ae7bd..d8e3437d037f2a6beae59c4a2167dcbca9af2e56 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -319,6 +319,7 @@ int main(int argc, char **argv)
   int ibwps=24;
   int ibwp_rboffset=41;
   int params_from_file = 0;
+  int threadCnt=1;
   if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) {
     exit_fun("[NR_ULSIM] Error, configuration module init failed\n");
   }
@@ -329,7 +330,7 @@ int main(int argc, char **argv)
   /* initialize the sin-cos table */
    InitSinLUT();
 
-  while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:ikl:m:n:p:r:s:u:w:y:z:F:G:H:M:N:PR:S:T:U:L:Z")) != -1) {
+  while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:ikl:m:n:p:r:s:t:u:w:y:z:F:G:H:M:N:PR:S:T:U:L:Z")) != -1) {
     printf("handling optarg %c\n",c);
     switch (c) {
 
@@ -454,7 +455,9 @@ int main(int argc, char **argv)
       snr0 = atof(optarg);
       printf("Setting SNR0 to %f\n", snr0);
       break;
-
+    case 't':
+      threadCnt = atoi(optarg);
+      break;
     case 'u':
       mu = atoi(optarg);
       break;
@@ -662,7 +665,14 @@ int main(int argc, char **argv)
   gNB->ofdm_offset_divisor = UINT_MAX;
   gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
   gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
-  char tp_param[] = "n";
+  char tp_param[80];
+  sprintf(tp_param,"-1");
+  int s_offset = 0;
+  for (int icpu=1; icpu<threadCnt; icpu++) {
+    sprintf(tp_param+2+s_offset,",-1");
+    s_offset += 3;
+  }
+
   initTpool(tp_param, gNB->threadPool, false);
   initNotifiedFIFO(gNB->respDecode);
   gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));