iMac screen goes blank on switching to Target Display Mode
I have a late 2013 iMac that I am trying to use as an external display for my mid 2012 MacBook Pro. I have them connected with a thunderbolt cable. When I hit Command-F2 on the iMac, the iMac screen goes blank and does not display any thing that is on my MacBook Pro. When I bring up the display settings on my MacBook Pro, I cannot see the iMac as an external display. I am pretty sure that the iMac can see my MacBook Pro as when I disconnect the cable, the iMac comes out of TDM and shows the login sceen. I can also feel the head of the thunderbolt cable getting warm, so there must be data being exchanged between the two. I can however, not figure out if the problem is with my cable or I am missing a driver in either of the machines. I don't think the latter should be the case as both my machines are up to date. Also, both of them are running OS X Mavericks.
Any help is appreciated.
iMac (27-inch, Late 2013), OS X Mavericks (10.9)