Nvidia optimus errors

Hello, I i am using Nvidia Optimus with bumblebee, it is fine, but if i try to use Xrand with settings in ./xinitrc :

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

I am getting this error:

X Toolkit Warning: Representation size 8 must match superclass’s to override tbxmImage

Failed to handle error condition correctly - exiting
General Fault Exception

====================
Fatal error detected

What could be the problem?
Thank you.

P.S.: all Programs are working, except this one - Siemens NX.

Tomas