How to build nvidia-340xx with linux511?

It doesn’t build for 511. Many fatal errors. Probably needs new patches.