In this paper, the bioconvective nanofluid flow in a porous square cavity containing gyrotactic microorganisms in the presence of heat generation/absorption is investigated. The bioconvection flow in porous medium is formulated based on Darcy model of Boussinesq approximation. Galerkin finite elements method is employed to solve the governing equations. The numerical results are obtained and discussed the effect of parameters such as Rayleigh number Ra, bioconvection number Rayleigh number Rb, Peclet number Pe, Lewis number Le, Brownian motion Nb, Thermophoresis Nt, Schmidt number Sc, Prandtl number Pr, heat generation/absorption Q and buoyancy ratio Nr. Also, the average Sherwood number, average Nusselt number and average density number are discussed. The present solutions are validated with existing studies under limited cases. It is found that Peclet number and buoyancy ratio show a significant increasing effect on the streamlines, isotherms, isoconcentrations of nanoparticles and microorganisms. The heat generation/absorption reverses the patterns of the flow, temperature distribution and isoconcentrations of nanoparticles and microorganisms.