cudadevice-emulation

Is there a way to emulate multiple GPUs with one?


I am designing a multi-gpu cuda code but I still don't have the machinery to actually develop the code. So, until I do,

Do you know if there is someway to emulate a multiple gpu enviroment just by using one gpu?

I suppose that such a thing, if it exists, would be very limited but it would allow me to test my ideas until I get the hardware I want.

Thanks!


Solution

  • Something close can be approximated using the CUDA Driver API (cuCtxCreate, cuCtxSetCurrent). See CUDA C Programming Guide Appendix G.4 Interoperability between Runtime and Driver API. Before calling any cuda* functions use cuCtxCreate to create two contexts on the device. Use cuCtxSetCurrent in place of cudaSetDevice.