diff --git a/CMakeLists.txt b/CMakeLists.txt index fd65953d..0b40476e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,7 +206,7 @@ set_target_properties (rai_wallet qt_test PROPERTIES LINK_FLAGS "${PLATFORM_LINK if (WIN32) set (PLATFORM_LIBS ws2_32 mswsock) else (WIN32) - set (PLATFORM_LIBS pthread) + set (PLATFORM_LIBS pthread OpenCL) endif (WIN32) if (WIN32) diff --git a/rai/node/node.cpp b/rai/node/node.cpp index 0a0c813f..b8e4bf89 100644 --- a/rai/node/node.cpp +++ b/rai/node/node.cpp @@ -2468,6 +2468,17 @@ bool rai::handle_node_options (boost::program_options::variables_map & vm) rai::uint256_union junk2 (0); rai::kdf kdf; kdf.phs (junk1, "", junk2); + std::cout << "Dumping OpenCL information" << std::endl; + bool error (false); + rai::opencl_environment environment (error); + if (!error) + { + environment.dump (); + } + else + { + std::cout << "Error initializing OpenCL" << std::endl; + } } else if (vm.count ("key_create")) { @@ -2962,4 +2973,4 @@ work (false) auto working (rai::working_path ()); boost::filesystem::create_directories (working); node = std::make_shared (init, *service, 24000, working, alarm, logging, work); -} \ No newline at end of file +} diff --git a/rai/node/openclwork.cpp b/rai/node/openclwork.cpp index 632e36b8..d676f94e 100644 --- a/rai/node/openclwork.cpp +++ b/rai/node/openclwork.cpp @@ -410,6 +410,12 @@ rai::opencl_environment::opencl_environment (bool & error_a) void rai::opencl_environment::dump () { auto index (0); + auto device_count (0); + for (auto & i: devices) + { + device_count += i.second.size (); + } + std::cout << boost::str (boost::format ("Found %1% platforms and %2% devices\n") % devices.size () % device_count); for (auto i (devices.begin ()), n (devices.end ()); i != n; ++i, ++index) { std::vector queries = {CL_PLATFORM_PROFILE, CL_PLATFORM_VERSION, CL_PLATFORM_NAME, CL_PLATFORM_VENDOR, CL_PLATFORM_EXTENSIONS}; @@ -591,4 +597,4 @@ uint64_t rai::opencl_work::generate_work (rai::uint256_union const & root_a) cl_int finishError = clFinish (queue); } return result; -} \ No newline at end of file +}