ubuntu 16.04 gives "X Error of failed request: BadValue (integer parameter out of range for operation)" when running OpenGL programs

I have two two graphic card on board, one is the integrating in Intel cpu, one is the nvidia card. I want use the integrating one to render desktop, the NV card to calculate with cuda. I switch to...