A three-dimensional inverse heat conduction problem is solved in the present study by using the conjugate gradient method (CGM) and the general-purpose commercial code $CFD\u2212ACE+$ to estimate the strength of the unknown heat generation for an encapsulated chip in a three-dimensional irregular domain. The advantage of calling $CFD\u2212ACE+$ code as a subroutine in the present inverse calculation lies in that many difficult but practical 3D inverse problem can be solved under this construction since the general-purpose commercial code has the ability to solve the direct problem easily. The results obtained by using the CGM to solve this 3D inverse problem are justified based on the numerical experiments using the simulated exact and inexact measurements. It is concluded that reliable heat generation can be estimated by the present inverse algorithm.