Enable running objectives with 0 GPU. (#3878)
* Enable running objectives with 0 GPU. * Enable 0 GPU for objectives. * Add doc for GPU objectives. * Fix some objectives defaulted to running on all GPUs.
This commit is contained in:
@@ -165,7 +165,7 @@ class GPUSet {
|
||||
CHECK_GE(n_gpus, -1) << "n_gpus must be >= -1.";
|
||||
|
||||
GpuIdType const n_devices_visible = AllVisible().Size();
|
||||
if (n_devices_visible == 0) { return Empty(); }
|
||||
if (n_devices_visible == 0 || n_gpus == 0) { return Empty(); }
|
||||
|
||||
GpuIdType const n_available_devices = n_devices_visible - gpu_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user