Questions tagged [gpu-managed-memory]

11 questions
4
votes
1 answer

What is the difference between mapped memory and managed memory?

I have been reading about the various approaches to memory management offered by CUDA, and I'm struggling to understand the difference between mapped memory: int *foo; std::size_t size = 32; cudaHostAlloc(&foo, size, cudaHostAllocMapped); ...and…
QuaternionsRock
  • 832
  • 7
  • 14
2
votes
0 answers

cudaMallocPitch for managed memory

I just realized that CUDA only offers cudaMallocManaged to allocate managed memory. But what should I do when I need to allocate a 2D or 3D array which should be done by cudaMallocPitch for better coalescing? There are no managed memory pendants of…
Michael
  • 7,407
  • 8
  • 41
  • 84
1
vote
0 answers

How to release GPU memory in tensorflow? (opposite of `allow_growth` → `allow_shrink`?)

I'm using a GPU to train quite a lot of models. I want to tune the architecture of the network, so I train different models sequentially to compare their performances (I'm using keras-tuner). The problem is that some models are very small, and some…
leleogere
  • 908
  • 2
  • 15
1
vote
1 answer

CUDA managed memory doesn't work with different compute capability

This code doesn't work in the same way when compiled with different compute capabilities: #include #include __managed__ int m; int main() { printf("hi 1\n"); m = -123; printf("hi 2\n"); } Device with compute…
user8044236
1
vote
1 answer

CUDA - how bad is the performance penalty for copying entire class of managed memory

I have some classes that derive from a managed memory allocator, so for example: /* --------- managed is from…
danwanban
  • 11
  • 2
0
votes
0 answers

Is it possible to use CUDA Managed Memory in WSL2?

I have a program that works well in linux (Ubuntu 22.04) with NVCC (11.5) that uses managed memory. When I bring this code to a Windows machine with WSL the portion of the code that actually uses the Managed Memory crashes with a segmentation…
alfC
  • 14,261
  • 4
  • 67
  • 118
0
votes
2 answers

How can you use managed (unified) memory for an image?

I have spent all day yesterday reading how to use managed (unified) memory array for a CUDA program (using the book Professional CUDA Programming, practiced some of the sample code (although I still got doubts about the profiler info) and I am ready…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
0
votes
1 answer

Placement new after cuda malloc managed memory

I have terrible errors with CUDA managed allocation. I'd like to confirm that the following code is correct: T* x; cudaMallocManaged(&x, sizeof(*x)); new(x) T(..) Is placement new syntax supported by CUDA version 11. Thanks.
Pierre T.
  • 380
  • 1
  • 13
0
votes
1 answer

How to access Managed memory simultaneously by CPU and GPU in compute capability 5.0?

Since simultaneous access to managed memory on devices of compute capability lower than 6.x is not possible (CUDA Toolkit Documentation), is there a way to simulatneously access managed memory by CPU and GPU with compute capability 5.0 or any method…
RAJ
  • 3
  • 4
0
votes
1 answer

How to specify GPU id for cudaMemAdviseSetPreferredLocation

I keep getting "invalid device ordinal" when trying to set the preferred location of managed memory to GPU #0: CUDA_ERR_CHECK(cudaMemAdvise(deviceMemoryHeap.pool, size, cudaMemAdviseSetPreferredLocation, 0)); The only thing that works is…
Dmitry Mikushin
  • 1,478
  • 15
  • 16
-1
votes
1 answer

Variable in the shared and managed memory in cuda

With the unified memory feature now in CUDA, variables can be in the managed memory and this makes the code a little simpler. Whereas the shared memory is shared between threads in a thread block. See section 3.2 in CUDA Fortran. My question is can…