Pinned and Pageable memory

Hi,
A general question. I have two machines (out of few) where pageable and pinned memory has the same throughput when I run NVIDIA’s bandwidth test.
Any idea how come the pageable memory shows the same throughput as pinned?

13:34 1_Utilities/bandwidthTest: ./bandwidthTest --memory=pageable
[CUDA Bandwidth Test] - Starting...
Running on...
 Device 0: GeForce GT 730
 Quick Mode
 Host to Device Bandwidth, 1 Device(s)
 PAGEABLE Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     3156.2
 Device to Host Bandwidth, 1 Device(s)
 PAGEABLE Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     3163.5
 Device to Device Bandwidth, 1 Device(s)
 PAGEABLE Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     11536.1
Result = PASS
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
13:34 1_Utilities/bandwidthTest: ./bandwidthTest --memory=pinned
[CUDA Bandwidth Test] - Starting...
Running on...
 Device 0: GeForce GT 730
 Quick Mode
 Host to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     3220.8
 Device to Host Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     3274.4
 Device to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(MB/s)
   33554432                     11545.2
Result = PASS
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
13:34 1_Utilities/bandwidthTest: uname -a
Linux ubuntu 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
13:34 1_Utilities/bandwidthTest: lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 60
Stepping:              3
CPU MHz:               800.000
BogoMIPS:              7183.56
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7
13:34 1_Utilities/bandwidthTest: nvidia-smi
Thu Jan 16 13:34:39 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.48                 Driver Version: 367.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 730      Off  | 0000:01:00.0     N/A |                  N/A |
| N/A   38C    P0    N/A /  N/A |    372MiB /  2000MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GT 630      Off  | 0000:05:00.0     N/A |                  N/A |
| 45%   31C   P12    N/A /  N/A |      0MiB /  1984MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

thanks
Eyal

2 Likes

because the bandwidth is not limited by pinned/pageable but instead is hitting a lower limit due to your PCIE connection

1 Like

Those results are very dependent of multiple factors of your system hardware.

Try adding –mode=shmoo to your command like

./bandwidthTest --memory=pageable --mode=shmoo

I’m seeing 2x performance in pinned over pageable for certain transfer sizes.

Matt

Thanks Robert!
That makes sense for that old machine (the one I posted before)… what could be the reason
in a newer one? where I get:

Pageable:
 Host to Device Bandwidth, 1 Device(s)
 PAGEABLE Memory Transfers
   Transfer Size (Bytes)	Bandwidth(GB/s)
   32000000			9.7

 Device to Host Bandwidth, 1 Device(s)
 PAGEABLE Memory Transfers
   Transfer Size (Bytes)	Bandwidth(GB/s)
   32000000			10.5

Pinned:

 Host to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)	Bandwidth(GB/s)
   32000000			11.4

 Device to Host Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)	Bandwidth(GB/s)
   32000000			11.6
0 ✓ sqream@host-100 /usr/local/sqream-prerequisites/versions/3.56/samples/1_Utilities/bandwidthTest $ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz
Stepping:              2
CPU MHz:               3400.000
CPU max MHz:           3600.0000
CPU min MHz:           1200.0000
BogoMIPS:              6399.53
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc

For pageable host memory, the transfer becomes a two-stage process. From host memory owned by the user process to a pinned host buffer owned by the CUDA driver, from there per DMA to the GPU.

So the faster the host->host copy, the smaller the difference between transfers from pinned vs. pageable memory. Depending on how much bandwidth the system memory of the host has (e.g. a DDR4-2666 channel provides about 17 GB/s real-world), the impact of using pageable memory may be as little as 10%. Which is approximately what you are seeing.

Once PCIe4 is introduced (presumably with the next GPU generation due in 2020), the difference should become more noticeable again, as the transfer rate across PCIe will approximately double.

1 Like

Thanks a lot for the answers guys!