"Unattributed context" that is destroying my performance in my Vulkan render engine on Linux

Hello fellas,

I have been experiencing some issues regarding the rendering in my engine with Vulkan. I ported the engine from windows and for some reason, my performance on the Linux is a lot worse then on windows. Like frame rate is half of the windows version. So I decided to fire up the nsight and investigate what is casing that. Here is the picture of the GPU trace:

As you ca see, every single frame is followed buy this blue trace (PCI throughput) where my GPU is literally not doing anything except streaming some unknown data. This was not happening on the Windows version of the engine. The situation is even weirder if I disable all the drawing and just present a black swapchain image to the screen; unattributed context is everywhere.

When I run nvidia-smi in the terminal, the only thing that is using my GPU is my engine, kwin_wayland and xorg. I also tried switching to X, similar thing was happening there although much less synchronized that kinda gave better performance, but still worse then windows. I also tried running default vkcube application that comes with Vulkan SDK, similar thing was happening there as well. Note that I also have the dual gpu, integrated AMD one and GTX1650.

I’m really not sure where to go next, if anyone has any idea on what could be causing this I would like to hear it because I’m completely stuck.

Thanks for reading :)

Hi maregames48,

Thank you for using Nsight Graphics and providing your feedback. This doesn’t look like a bug of Nsight Graphics IMHO.

It’s weird to see such blue PCI throughput, does this happen on dedicate GPU? For example, you just use the GTX1650 only? Does this happen on other machines (refresh Linux with X11, for example)?

Thanks
An

Hi AYan, thanks for reading.

Since the last post I did some further testing and I have some new results. Last time I did’t looked at the GPU Activity tab, this time however I did and it looks like as soon as vkQueuePresentKHR() finishes, GPU starts copying the data, I assume back to the host since PCI Write is high. Then when kwin_wayland needs to do the rendering PCI Read is high, I assume its reading the data back from the host to the GPU memory. Here is a picture, I have hidden the unnecessary rows:

I also did the same test on X11 (xfce session), similar thing is still happening with this copying action, however now its using async copying while the GPU is executing my command buffer and that kinda improves performance, but there are still some frames that are not really that well synchronized, sometimes is still out of sync or even completely idle, making my framerate jump from 400fps to 1000fps while rendering the same picture all the time. Here is the capture of X11 session:

I also tried to switch to nvidia GPU only with sudo prime-select nvidia`, but it just returned the black screen. I also edited /etc/enviroment for every program to use the nvidia GPU with __NV_PRIME_RENDER_OFFLOAD=1 and __GLX_VENDOR_LIBRARY_NAME=nvidia, same issue is still there.

So yeah, I don’t think that this issue is with nsight anymore as well, I’m not sure if I should close this topic now and reopen it in linux graphics or some other more related category.

Thanks :)

Hi maregames48,

You can leave it and post some new topic in Linux Graphics topic, it looks like some graphics stutter issue.

By the way, could you please try the latest driver? Will it make things better?

Thanks
An

The copy is still not expected. Is the display connected to one of the other two GPUs?