We investigate the problem of giant planet formation around stars with various masses based on the core accretion/gas capture model. At first, we follow the evolution of gas and solids from the moment when all solids are in the form of small grains to the stage when most of them have reached planetesimal size. We show that the surface density of a planetesimal swarm tends to be higher around less massive stars. Subsequently, we derive the minimum surface density of the planetesimal swarm required for the formation of giant planets, both in a numerical and in an approximate analytical approach. We combine these results by calculating a set of representative disk models, characterized by different masses, sizes, and metallicities. This allows us to quantify the probability of each individual disk model to form giant planets. Furthermore, we take the fact into account, that in some of these models, the outer regions of the disks become gravitationally unstable.