/usr/bin/ton/crypto/pow-miner-opencl
OpenCL platforms count: 1
Error -1 executing clGetDeviceIDs(platforms_[p], CL_DEVICE_TYPE_ALL, 0, NULL, &device_count_) on /usr/src/pow-miner-gpu/crypto/util/opencl/opencl.cpp:54 (device not found). Aborting.
Аварийный останов (стек памяти сброшен на диск)
exit status: 134
Line opencl.cpp:54
is this (I patched the sources insignificantly):
CL_WRAPPER(clGetDeviceIDs(platforms_[p], CL_DEVICE_TYPE_ALL, 0, NULL, &device_count_));
Let's try fixing this, I'm an sw dev, too.
rocm version:
ls -l /etc/alternatives/rocm
lrwxrwxrwx 1 root root 15 2021-10-20 15:39:23 +08 nanoseconds:374296976 ADC /etc/alternatives/rocm -> /opt/rocm-4.3.0
rocm installed pkgs:
aptitude search rocm|grep "^i "
i A rocm-clang-ocl - OpenCL compilation with clang compiler.
i A rocm-cmake - rocm-cmake built using CMake
i A rocm-dbgapi - Library to provide AMD GPU debugger API
i A rocm-debug-agent - Radeon Open Compute Debug Agent (ROCdebug-agent)
i A rocm-dev - Radeon Open Compute (ROCm) Runtime software stack
i A rocm-device-libs - Radeon Open Compute - device libraries
i rocm-dkms - Radeon Open Compute (ROCm) Runtime software stack
i A rocm-gdb - ROCgdb
i A rocm-opencl - OpenCL: Open Computing Language on ROCclr
i A rocm-opencl-dev - OpenCL: Open Computing Language on ROCclr
i A rocm-smi-lib - AMD System Management libraries
i A rocm-utils - Radeon Open Compute (ROCm) Runtime software stack
i A rocminfo - Radeon Open Compute (ROCm) Runtime rocminfo tool
My GPU is a 480:
clinfo -v
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.0 AMD-APP (3305.0)
Platform Name: AMD Accelerated Parallel Processing
Platform Vendor: Advanced Micro Devices, Inc.
Platform Extensions: cl_khr_icd cl_amd_event_callback
Platform Name: AMD Accelerated Parallel Processing
Number of devices: 1
Device Type: CL_DEVICE_TYPE_GPU
Vendor ID: 1002h
Board name: Ellesmere [Radeon RX 470/480/570/570X/580/580X]
...
git log|head -1
commit 2269a332e37fc4e27b8a7ca00337cae1e4922a25
patch I did:
git diff
diff --git a/crypto/util/opencl/opencl.cpp b/crypto/util/opencl/opencl.cpp
index f04303d..047cf5d 100644
--- a/crypto/util/opencl/opencl.cpp
+++ b/crypto/util/opencl/opencl.cpp
@@ -9,6 +9,15 @@
#include <CL/cl.h>
#endif
+// for std::cerr
+#include <iostream>
+
+// for std::endl
+#include <ostream>
+
+// for abort
+#include <stdlib.h>
+
namespace opencl {
void OpenCL::load_source(const char *filename) {
@@ -35,6 +44,7 @@ void OpenCL::set_source(unsigned char *source, unsigned int length) {
void OpenCL::print_devices() {
// platform
CL_WRAPPER(clGetPlatformIDs(0, NULL, &platform_count_));
+ std::cerr << "OpenCL platforms count: " << platform_count_ << std::endl;
platforms_ = (cl_platform_id *)malloc(platform_count_ * sizeof(cl_platform_id));
CL_WRAPPER(clGetPlatformIDs(platform_count_, platforms_, NULL));
diff --git a/crypto/util/opencl/opencl_helper.h b/crypto/util/opencl/opencl_helper.h
index 890140d..1ae3163 100644
--- a/crypto/util/opencl/opencl_helper.h
+++ b/crypto/util/opencl/opencl_helper.h
@@ -19,7 +19,7 @@
{ \
cl_int err = FUNC; \
if (err != CL_SUCCESS) { \
- fprintf(stderr, "Error %d executing %s on %s:%d (%s)\n", \
+ fprintf(stderr, "Error %d executing %s on %s:%d (%s). Aborting.\n", \
err, #FUNC, __FILE__, __LINE__, cl_error_to_str(err)); \
abort(); \
}; \
diff --git a/storage/TorrentHeader.hpp b/storage/TorrentHeader.hpp
index 2b84ccb..51a273f 100644
--- a/storage/TorrentHeader.hpp
+++ b/storage/TorrentHeader.hpp
@@ -78,4 +78,7 @@ void TorrentHeader::parse(ParserT &parser) {
}
names = parser.template fetch_string_raw<std::string>(tot_names_size);
}
+
} // namespace ton
+
+template void ton::TorrentHeader::store<td::TlStorerCalcLength>(td::TlStorerCalcLength&) const;
OS:
$ lsb_release -dc
Description: Ubuntu 18.04.6 LTS
Codename: bionic
$ uname -a
Linux host1 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux