I wrote a for loop that continuously allocates 16MB of storage using the function cudaHostAlloc.:
cudaHostAlloc(&h_ptr, 16 * 1024 * 1024, cudaHostAllocDefault)
Only about 3.5GB can be allocated in total.
OS: Ubuntu 18.04.5 LTS
Memory information:
MemTotal: 131923304 kB
MemFree: 126884536 kB
MemAvailable: 128642668 kB
Buffers: 123244 kB
Cached: 2285032 kB
SwapCached: 0 kB
Active: 1090336 kB
Inactive: 1392524 kB
Active(anon): 75800 kB
Inactive(anon): 1804 kB
Active(file): 1014536 kB
Inactive(file): 1390720 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 2097148 kB
SwapFree: 2097148 kB
Dirty: 208 kB
Writeback: 0 kB
AnonPages: 74756 kB
Mapped: 81004 kB
Shmem: 2976 kB
Slab: 1348176 kB
SReclaimable: 379508 kB
SUnreclaim: 968668 kB
KernelStack: 21200 kB
PageTables: 413804 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 68058800 kB
Committed_AS: 210225332 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 2329600 kB
DirectMap2M: 12204032 kB
DirectMap1G: 120586240 kB
cuda tool kit version:
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0
The driver is installed together with the CUDA toolkit.
Is this due to some limitations in Linux that only such a large amount of storage space can be allocated?