The NVIDIA's official page gives a caveat.
Some versions of the “modesetting” driver try to load a sub-module called “glamor”, which conflicts with the NVIDIA GLX implementation. Please ensure that the libglamoregl.so X module is not installed.
Only if I rename or remove the /lib/xorg/modules/libglamoregl.so can I get the Optimus work. Disabling it in xorg.conf takes no effect.