What's the requirement of cg

Do I need GL_ARB_fragment_program and GL_ARB_vertex_program?

You need a card that supports GL_NV_vertex_program or GL_ARB_vertex_program (vertex programming) and for fragment programming you need a card that supports GL_NV_fragment_program, GL_ARB_fragment_program, or GL_NV_texture_shader+GL_NV_register_combiners.

And in case you don’t have all this in hardware, there’s an emulation tool for NVIDIA boards on http://developer.nvidia.com/view.asp?IO=nv30_emulation
which allows you to run all these in software (be warned, it’s slow).