ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
66 stars 29 forks source link

support for cuda_managed #111

Closed telegraphic closed 2 years ago

telegraphic commented 6 years ago

On the wishlist: ability to use space='cuda_managed' in blocks. Currently it'll fail like this:

memory.cpp:252 Condition failed: "Valid bfMemcpy2D src space"
memory.cpp:252 error 10: BF_STATUS_INVALID_ARGUMENT
jaycedowell commented 5 years ago

This is sorta kinda tangentially related but I get various warnings related to managed memory when I compile under CUDA 10.1:

memory.cpp: In function ‘BFstatus bfGetSpace(const void*, BFspace*)’:
memory.cpp:62:23: warning: ‘cudaPointerAttributes::isManaged’ is deprecated 
   (declared at /usr/local/cuda/include/driver_types.h:1341) 
   [-Wdeprecated-declarations]
  } else if( ptr_attrs.isManaged ) {
                       ^
memory.cpp:62:23: warning: ‘cudaPointerAttributes::isManaged’ is deprecated 
   (declared at /usr/local/cuda/include/driver_types.h:1341) 
   [-Wdeprecated-declarations]
memory.cpp:65:21: warning: ‘cudaPointerAttributes::memoryType’ is 
   deprecated (declared at /usr/local/cuda/include/driver_types.h:1302) 
   [-Wdeprecated-declarations]
   switch( ptr_attrs.memoryType ) {
                     ^
memory.cpp:65:21: warning: ‘cudaPointerAttributes::memoryType’ is 
   deprecated (declared at /usr/local/cuda/include/driver_types.h:1302) 
   [-Wdeprecated-declarations]

This may become an issue in future CUDA releases.

xsacha commented 4 years ago

Just change it to switch(ptr_attrs.type) and (ptr_attrs.type == cudaMemoryTypeManaged)

jaycedowell commented 2 years ago

I started thinking about this again and my currently thinking is that it would be easy to support cuda_managed for Pascal and later. From what I can tell this should work seamlessly on those generations of GPUs and doesn't require the the explicit stream synchronization call of earlier generations.

jaycedowell commented 2 years ago

https://github.com/ledatelescope/bifrost/commit/90dfc3d32948d1c6628d58f70c2375d8578d2ee5 starts work on cuda_managed support for Pascal and later GPUs. I also added a test suite in https://github.com/ledatelescope/bifrost/commit/d0552ee589a81d06bc22f0de4d45b8761e0fe0ba but I have an intermittent failures on the "reduce" tests.

jaycedowell commented 2 years ago

Closing with the release of v0.10.0.