Cubic inorganic perovskite CsPbI3 is a direct bandgap semiconductor, which is promising for optoelectronic applications, such as solar cells, light emitting diodes, and lasers. The intrinsic defects in semiconductors play crucial roles in determining carrier conductivity, the efficiency of carrier recombination, and so on. However, the thermodynamic stability and intrinsic defect physics are still unclear for cubic CsPbI3. By using the first-principles calculations, we study the thermodynamic process and find out that the window for CsPbI3 growth is quite narrow and the concentration of Cs is important for cubic CsPbI3 growth. Under Pb-rich conditions, VPb and VI can pin the Fermi energy in the middle of the bandgap, which results in a low carrier concentration. Under Pb-poor conditions, VPb is the dominant defect and the material has a high concentration of hole carriers with a long lifetime. Our present work gives an insight view of the defect physics of cubic CsPbI3 and will be beneficial for optoelectronic applications based on cubic CsPbI3 and other analogous inorganic perovskites.