Which version of Mahdi? Depending on the version (April release, beta release, or May aka Release 1) you need different versions of the baseband to have working sensors, rotation, GPS, etc.
If you are using a version prior to Release 1, you also need to flash a stock-based ROM in order to purposely configure the sensors.
IOW, you should read this post:
And then upgrade to Mahdi 2.5 Release 1, using the stock kitkat baseband.
Typos courtesy of my LG G2 (D803) running Mahdi-ROM.