Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/flamegpu/simulation/CUDAEnsemble.cu
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ unsigned int CUDAEnsemble::simulate(const RunPlanVector& plans) {
// Check that each device is capable, and init cuda context
for (auto d = devices.begin(); d != devices.end(); ++d) {
if (!detail::compute_capability::checkComputeCapability(*d)) {
fprintf(stderr, "FLAMEGPU2 has not been built with an appropriate compute capability for device %d, this device will not be used.\n", *d);
// Emit a warning unless quiet verbosity was specified.
if (config.verbosity >= Verbosity::Default) {
fprintf(stderr, "FLAMEGPU2 has not been built with an appropriate compute capability for device %d, this device will not be used.\n", *d);
}
d = devices.erase(d);
--d;
} else {
Expand All @@ -187,7 +190,7 @@ unsigned int CUDAEnsemble::simulate(const RunPlanVector& plans) {
// If there are no devices left (and mpi is not being used), we need to error as the work cannot be executed.
#ifndef FLAMEGPU_ENABLE_MPI
if (devices.size() == 0) {
THROW exception::InvalidCUDAdevice("FLAMEGPU2 has not been built with an appropraite compute capability for any devices, unable to continue\n");
THROW exception::InvalidCUDAdevice("FLAMEGPU2 has not been built with an appropriate compute capability for any devices, unable to continue\n");
}
#endif // ifndef FLAMEGPU_ENABLE_MPI

Expand Down
2 changes: 1 addition & 1 deletion tests/python/simulation/test_cuda_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def test_ensemble_verbosity_verbose(self):
assert "CUDAEnsemble progress" in captured.out
assert "CUDAEnsemble completed" in captured.out
assert "Ensemble time elapsed" in captured.out
assert captured.err == ""
assert captured.err == "" or "FLAMEGPU2 has not been built with an appropriate compute capability for device" in captured.errr

@pytest.fixture(autouse=True)
def capsys(self, capsys):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_cases/simulation/test_cuda_ensemble.cu
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ TEST(TestCUDAEnsemble, verbosity) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(output.find("Ensemble time elapsed") == std::string::npos); // E.g. Ensemble time elapsed: 0.006000s
EXPECT_TRUE(errors.empty());
// Errors should be empty but may contain compute capability warnings in mixed-architecture multi-GPU systems depending on compute capability options.
EXPECT_TRUE(errors.empty() || output.find("FLAMEGPU2 has not been built with an appropriate compute capability for device"));
}
// Verbosity::Verbose
{
Expand All @@ -444,7 +445,8 @@ TEST(TestCUDAEnsemble, verbosity) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(output.find("Ensemble time elapsed") != std::string::npos); // E.g. Ensemble time elapsed: 0.006000s
EXPECT_TRUE(errors.empty());
// Errors should be empty but may contain compute capability warnings in mixed-architecture multi-GPU systems depending on compute capability options.
EXPECT_TRUE(errors.empty() || output.find("FLAMEGPU2 has not been built with an appropriate compute capability for device"));
}
}
// Logging is more thoroughly tested in Logging. Here just make sure the methods work
Expand Down