The major problem is ASIO.
its recommended that you use your devices ASIO driver but Windows can't use ASIO drivers. So it changes to use MME or WDM. the problem occurs if Windows decides to hang onto the audio device and you can't use the one that Sonar's setup to use, which should be ASIO.
The other problem that often trips people up is that Windows only uses 16 bit audio @ 44.1 kHz and if set to play Window's sounds then the bitrate and sample rate may be even lower.
When you start up Sonar, it may not only get the driver from Windows it may get the bit depth and sample rate changed to other than 24 bit @ 44.1 (this is the recommended bit depth) and all sorts of inconsistencies start to occur, like a message that says that the sample rate is wrong.
Their are 2 schools of thought:
1. says to only use one device for everything, though this can mean the occasional problem with settings.
2. says to you use your quality audio device (in your case the UX2) for Sonar and use your on-board sound card/device for Windows and other sounds. Kind of like a decoy.
My experiences is that the second choice is preferable.