DPDK usage discussions
 help / color / mirror / Atom feed
* Issue with Cannot allocate memory when using 32-bit DPDK application
@ 2024-07-02 10:17 洪全
  2024-07-02 15:08 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: 洪全 @ 2024-07-02 10:17 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 2667 bytes --]

Dear DPDK community,


I am encountering an issue when attempting to run a 32-bit DPDK application on Linux. Specifically, I am facing a "Cannot allocate memory" error during initialization. While I can mitigate this issue by using the `--no-huge` option, it adversely affects the performance of my application.


Here is the error output I receive:


```
sudo ./app -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_tap001,iface=tap001 --no-pci
EAL: Detected CPU lcores: 2
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/pmd1/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: Cannot get a virtual area: Cannot allocate memory
EAL: Cannot allocate VA space for memseg list, retrying with different page size
EAL: Cannot allocate VA space on socket 0
EAL: FATAL: Cannot init memory
EAL: Cannot init memory
app: main.c:284: main: Assertion `(ret = rte_eal_init(argc, (char **) argv)) >= 0' failed.
Aborted
```


When debugging with `--log-level=eal,8`, the relevant portion of the output indicates attempts to allocate memory:


```
EAL: Attempting to preallocate 2048M on socket 0
EAL: Ask a virtual area of 0xc000 bytes
EAL: Virtual area found at 0xeb077000 (size = 0xc000)
EAL: Memseg list allocated at socket 0, page size 0x800kB
EAL: Ask a virtual area of 0x80000000 bytes
EAL: Cannot mmap((nil), 0x80200000, 0x0, 0x22, -1, 0x0): Cannot allocate memory
EAL: Cannot get a virtual area: Cannot allocate memory
EAL: Cannot allocate VA space for memseg list, retrying with different page size
EAL: Cannot allocate VA space on socket 0
EAL: FATAL: Cannot init memory
EAL: Cannot init memory
app: main.c:284: main: Assertion `(ret = rte_eal_init(argc, (char **) argv)) >= 0' failed.
Aborted
```


System information:
- Hugepages configured: `echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages`
- Hugepages mounted: `mount -t hugetlbfs hugetlbfs /dev/hugepages`
- NUMA node information: `numactl --hardware`
  - available: 1 nodes (0)
  - node 0 cpus: 0 1
  - node 0 size: 7896 MB
  - node 0 free: 3915 MB
  - node distances:
    - node 0: 10


DPDK version: 22.03
Distribution: Ubuntu 22.04
Kernel information: Linux hq-virtual-machine 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux


I believe the issue stems from the attempt to preallocate 2048M on socket 0, but using `-m` or `--socket-mem` options did not resolve the problem.


Could you please provide guidance on how to properly configure DPDK to avoid this memory allocation issue while maximizing performance?


Thank you for your assistance.




Best regards,

Quan Hong

[-- Attachment #2: Type: text/html, Size: 5601 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Issue with Cannot allocate memory when using 32-bit DPDK application
@ 2024-07-02 10:11 洪全
  0 siblings, 0 replies; 6+ messages in thread
From: 洪全 @ 2024-07-02 10:11 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 2667 bytes --]

Dear DPDK community,


I am encountering an issue when attempting to run a 32-bit DPDK application on Linux. Specifically, I am facing a "Cannot allocate memory" error during initialization. While I can mitigate this issue by using the `--no-huge` option, it adversely affects the performance of my application.


Here is the error output I receive:


```
sudo ./app -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_tap001,iface=tap001 --no-pci
EAL: Detected CPU lcores: 2
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/pmd1/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: Cannot get a virtual area: Cannot allocate memory
EAL: Cannot allocate VA space for memseg list, retrying with different page size
EAL: Cannot allocate VA space on socket 0
EAL: FATAL: Cannot init memory
EAL: Cannot init memory
app: main.c:284: main: Assertion `(ret = rte_eal_init(argc, (char **) argv)) >= 0' failed.
Aborted
```


When debugging with `--log-level=eal,8`, the relevant portion of the output indicates attempts to allocate memory:


```
EAL: Attempting to preallocate 2048M on socket 0
EAL: Ask a virtual area of 0xc000 bytes
EAL: Virtual area found at 0xeb077000 (size = 0xc000)
EAL: Memseg list allocated at socket 0, page size 0x800kB
EAL: Ask a virtual area of 0x80000000 bytes
EAL: Cannot mmap((nil), 0x80200000, 0x0, 0x22, -1, 0x0): Cannot allocate memory
EAL: Cannot get a virtual area: Cannot allocate memory
EAL: Cannot allocate VA space for memseg list, retrying with different page size
EAL: Cannot allocate VA space on socket 0
EAL: FATAL: Cannot init memory
EAL: Cannot init memory
app: main.c:284: main: Assertion `(ret = rte_eal_init(argc, (char **) argv)) >= 0' failed.
Aborted
```


System information:
- Hugepages configured: `echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages`
- Hugepages mounted: `mount -t hugetlbfs hugetlbfs /dev/hugepages`
- NUMA node information: `numactl --hardware`
  - available: 1 nodes (0)
  - node 0 cpus: 0 1
  - node 0 size: 7896 MB
  - node 0 free: 3915 MB
  - node distances:
    - node 0: 10


DPDK version: 22.03
Distribution: Ubuntu 22.04
Kernel information: Linux hq-virtual-machine 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux


I believe the issue stems from the attempt to preallocate 2048M on socket 0, but using `-m` or `--socket-mem` options did not resolve the problem.


Could you please provide guidance on how to properly configure DPDK to avoid this memory allocation issue while maximizing performance?


Thank you for your assistance.




Best regards,

Quan Hong

[-- Attachment #2: Type: text/html, Size: 5599 bytes --]

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

end of thread, other threads:[~2024-07-03  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-02 10:17 Issue with Cannot allocate memory when using 32-bit DPDK application 洪全
2024-07-02 15:08 ` Stephen Hemminger
2024-07-03  2:18   ` 洪全
2024-07-03  5:43     ` Stephen Hemminger
2024-07-03  6:04       ` 洪全
  -- strict thread matches above, loose matches on Subject: below --
2024-07-02 10:11 洪全

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).