Modified Knapsack Problem
You can't.  If the function $V$  (for computing the $v_i$'s) is arbitrary, in the worst case you will need to try all possible combinations of quality levels -- there is no algorithm faster in the worst case.  That takes exponential time.

To do better, we need to know something about the function $V$: e.g., about its structure or proeprties.