Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Use only CUDA devices with a supported architecture #299

Open
wants to merge 1 commit into
base: CMSSW_11_1_X_Patatrack
Choose a base branch
from

Conversation

fwyzard
Copy link

@fwyzard fwyzard commented Mar 24, 2019

For each available CUDA device, check if its architecture is supported running a simple kernel.
This allows to restrict using only the supported devices

  • at configuration time, in the SwitchProducerCUDA, via the cudaIsEnabled test;
  • at run time, in the CUDAService and its clients;
  • when running tests, via exitSansCUDADevices.

Includes Matti's fix for the sizes of stream and event caches (#289).

@fwyzard
Copy link
Author

fwyzard commented Mar 24, 2019

Second attempt at #286, mostly to check if we can find a working set of CUDA build rules for this use case.

@fwyzard
Copy link
Author

fwyzard commented Mar 24, 2019

The present CUDA rules do not allow to have .cu files both in a shared library and in a plugin.

@fwyzard fwyzard added the bug label Mar 24, 2019
@makortel
Copy link

Just to note (in case it was not intentional) that now there are implementations of supportedCUDADevices() in both HeterogeneousCore/CUDAServices and HeterogeneousCore/CUDAUtilities.

@fwyzard
Copy link
Author

fwyzard commented Mar 25, 2019

Sorry about that, I'll clean it up.

For each available CUDA device, check if its architecture is supported running a simple kernel.
This allows to restrict using only the supported devices
  - at configuration time, in the SwitchProducerCUDA, via the cudaIsEnabled test;
  - at run time, in the CUDAService and its clients;
  - when running tests, via exitSansCUDADevices.

Includes Matti's fix for the sizes of stream and event caches (cms-sw#289).
@fwyzard fwyzard force-pushed the Patatrack_use_only_supported_devices branch from 2be0bc1 to 8deb1d9 Compare March 25, 2019 16:14
@makortel
Copy link

makortel commented Apr 2, 2019

The logic here

CUDAESProduct(): gpuDataPerDevice_(numberOfCUDADevices()) {

int numberOfCUDADevices() {
edm::Service<CUDAService> cs;
return cs->enabled() ? cs->numberOfDevices() : 0;
}

edm::Service<CUDAService> cs;
auto device = cs->getCurrentDevice();
auto& data = gpuDataPerDevice_[device];

needs to be updated as well.

@fwyzard fwyzard changed the base branch from CMSSW_10_5_X_Patatrack to CMSSW_11_1_X_Patatrack May 30, 2020 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants