vnc server on nvidia linux does not refresh screen after every keystroke

I have the exact same problem on Ubuntu 18.04. My Nvida card is GeForce RTX 2080 Ti, so it seems this is not due to an older card, but I have no idea what is causing this problem or how to fix it.