Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can gpu use swap space when its ram is full?

I'm doing some gpu calculation using OpenCL where I need to create a buffer with size about 5 GB. My laptop has an integrated gpu with 1.5 GB ram size. I tried to run the code and it gave the wrong result. So I guess it's because the ram of gpu is full. My question is that whether there is some "swap space"(or virtual memory) that gpu can utilize when its ram is full? I know that cpu has this mechanism. But I'm not sure for gpu.

like image 404
andy90 Avatar asked Sep 03 '25 16:09

andy90


1 Answers

No, it cannot (at least on most GPUs). Because the GPU uses its own memory (the RAM on your graphics card) in general.

Also OpenCL code in your kernels don't do any malloc (inside the kernel). You'll use clCreateBuffer

like image 55
Basile Starynkevitch Avatar answered Sep 05 '25 14:09

Basile Starynkevitch