Most of previous studies investigated the optimal control of HIV infection at either within-host or between-host level. However, the optimal treatment strategy for the individual may not be optimal for the population and vice versa. To determine when the two-level optimal controls are in accord or conflict, we develop a multi-scale model using various functions that link the viral load within host and the transmission rate between hosts, calibrated by cohort data. We obtain the within-host optimal treatment scheme that minimizes the viral load and maximizes the count of healthy cells at the individual level, and the coupled optimal scheme that minimizes the basic reproduction number at the population level. Mathematical analysis shows that whether the two-level optimal controls coincide depends on the sign of the product of their switching functions. Numerical results suggest that they are in accord for a high maximal drug efficacy but may conflict for a low drug efficacy. Using the multi-scale model, we also identify a threshold of the treatment effectiveness that determines how early treatment initiation can affect the disease dynamics among population. These results may help develop a synergistic treatment protocol beneficial to both HIV-infected individuals and the whole population.