Create an XF86Config-4 file using Xconfigurator. After that's done you need to make a few modifications to it. You need to edit the modules section. In there you need to disable/remove the lines that load GLcore and dri and you need to check if there's a line that loads glx.
After that you need to change the video driver in the device section from nv to nvidia. That's all.