Unable to select GPU when using RenderOffscreen

When using UnrealEngine based simulators (e.g. CARLA) in Linux with nvidia proprietary drivers, headless (i.e. no X-server) and OpenGL, we can use the SDL Environment Variable SDL_HINT_CUDA_DEVICE to select which GPU the process will run on. Unfortunately, this doesn’t appear to work with headless vulkan when using the RenderOffscreen flag with UE 4.25.4, every process just seems to use GPU 0. I am unaware of a general way (i.e. for any vulkan binary in Linux with the proprietary nvidia stack) to specify the GPU.

Is the inability to select which GPU to run UnrealEngine based programs on with headless Vulkan a bug or an expected limitation of sdl2/vulkan?

Hi qhaas, did you try adding “-graphicsadapter=N” where N is a zero-based number to select a GPU?

1 Like

That did the trick, thanks! It would be useful if that was included in the documentation where RenderOffscreen is mentioned.

I notice that it still lists GPU 0 as being in-use by the process, but the heavy lift is on GPU N. The OpenGL SDL environment variable approach only uses GPU N.