[Question]Memory allocation issue in multithread
ytian-xxxxxxxx opened this issue · comments
My program is c++ with arrayfire on windows platform. When I am using large number of threads to perform parallel computing on GPU, I will get my executable suddenly exit without any exception. I can imagine that the required GPU memory exceeds the max size, but a proper exception is expected.
The trace is as below:
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(155) ] nativeAlloc: 3.82 MB 0x2808000000
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(183) ] Running GC: current.lock_bytes(34580040704) >= current.max_bytes(2415820800) || current.total_buffers(6108) >= this->max_buffers(1000)
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\common\DefaultMemoryManager.cpp(69) ] GC: Clearing 1 buffers 3.82 MB
[mem][1711011949][12664] [ C:\Users\stef\coding\arrayfire\src\backend\cuda\memory.cpp(160) ] nativeFree: 0x2808000000
C:\Users\Administrator\Desktop\Release>%errorlevel%
'-1073741819'
Any suggestion for this issue?