I once had this with a colleague - one week getting on fine, next week cold shoulder.
So I asked him 'have I done something to offend you - like breathe?'
which as a jokey thing broke the ice and brought up the subject more easily. In my case it turned out I hadn't offended him, he just had things on his mind.