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

How to fix xmr-stak? #1

Closed
uentity opened this issue Jan 25, 2018 · 5 comments
Closed

How to fix xmr-stak? #1

uentity opened this issue Jan 25, 2018 · 5 comments

Comments

@uentity
Copy link

uentity commented Jan 25, 2018

@matszpk big thanks for your work!

I was able to compile and install custom mesa following your instructions And was able to start ethminer wing almost no hasharate drop! Only GUI session started to be a little unresponsive. Awesome!

Can you please share your modifications of xmr-stak? It segfaults soon after starting.

And one more thing: I have this in clinfo output:

  Address bits                                    64, Little-Endian
  Global memory size                              16737443840 (15.59GiB)
  Global free memory (AMD)                        <printDeviceInfo:73: get number of CL_DEVICE_GLOBAL_FREE_MEMORY_AMD : error -30>
  Global memory channels (AMD)                    <printDeviceInfo:74: get CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD : error -30>
  Global memory banks per channel (AMD)           <printDeviceInfo:75: get CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD : error -30>
  Global memory bank width (AMD)                  <printDeviceInfo:76: get CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD : error -30>
  Error Correction support                        No
  Max memory allocation                           7724397772 (7.194GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
    Base address alignment for 2D image buffers   <printDeviceInfo:101: get CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT : error -30>
    Pitch alignment for 2D image buffers          <printDeviceInfo:102: get CL_DEVICE_IMAGE_PITCH_ALIGNMENT : error -30>
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Local memory syze per CU (AMD)                  <printDeviceInfo:121: get CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD : error -30>
  Local memory banks (AMD)                        <printDeviceInfo:122: get CL_DEVICE_LOCAL_MEM_BANKS_AMD : error -30>
  Max constant buffer size                        2147483647 (2GiB)
  Max number of constant args                     16
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Profiling timer offset since Epoch (AMD)        <printDeviceInfo:139: get CL_DEVICE_PROFILING_TIMER_OFFSET_AMD : error -30>
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  <printDeviceInfo:143: get CL_DEVICE_THREAD_TRACE_SUPPORTED_AMD : error -30>
    SPIR versions                                 <printDeviceInfo:148: get   SPIR versions size : error -30>
@matszpk
Copy link
Owner

matszpk commented Jan 25, 2018

Ok. this is diff from original xmr-stak-2.1.0 and my working version:

--- /home/mat/docs/src/monero/origs/xmr-stak-2.1.0/xmrstak/backend/amd/amd_gpu/gpu.cpp
+++ /home/mat/docs/src/monero/xmr-stak-2.1.0/xmrstak/backend/amd/amd_gpu/gpu.cpp
@@ -172,7 +172,7 @@
 		return "CL_INVALID_LINKER_OPTIONS";
 	case CL_INVALID_DEVICE_PARTITION_COUNT:
 		return "CL_INVALID_DEVICE_PARTITION_COUNT";
-#if defined(CL_VERSION_2_0) && !defined(CONF_ENFORCE_OpenCL_1_2)
+#if 0
 	case CL_INVALID_PIPE_SIZE:
 		return "CL_INVALID_PIPE_SIZE";
 	case CL_INVALID_DEVICE_QUEUE:
@@ -231,14 +231,13 @@
 	 */
 	MaximumWorkSize /= 8;
 	printer::inst()->print_msg(L1,"Device %lu work size %lu / %lu.", ctx->deviceIdx, ctx->workSize, MaximumWorkSize);
-#if defined(CL_VERSION_2_0) && !defined(CONF_ENFORCE_OpenCL_1_2)
+#if 0
 	const cl_queue_properties CommandQueueProperties[] = { 0, 0, 0 };
 	ctx->CommandQueues = clCreateCommandQueueWithProperties(opencl_ctx, ctx->DeviceID, CommandQueueProperties, &ret);
 #else
 	const cl_command_queue_properties CommandQueueProperties = { 0 };
 	ctx->CommandQueues = clCreateCommandQueue(opencl_ctx, ctx->DeviceID, CommandQueueProperties, &ret);
 #endif
-
 	if(ret != CL_SUCCESS)
 	{
 		printer::inst()->print_msg(L1,"Error %s when calling clCreateCommandQueueWithProperties.", err_to_str(ret));
@@ -566,6 +565,7 @@
 				break;
 			}
 		}
+		platformIndex = 0;
 	}
 	else
 		printer::inst()->print_msg(L1,"WARNING: %s when calling clGetPlatformIDs for platform information.", err_to_str(clStatus));

@uentity
Copy link
Author

uentity commented Jan 25, 2018

Thanks! Works fine with 2.2.0!
And again with close to zero performance lost.

@uentity
Copy link
Author

uentity commented Jan 26, 2018

Tried xmr-stak on Vega 64 with mesa3d-comp-bridge. It is very unstable so far. Mining starts and I'm getting ~1130 H/s on one GPU thread (two threads don't increase performance in my experiments), but after a short period of time the xmr-stak process hangs and don't respond to anything (but OS works fine, I can do other tasks). I can't even kill it, the only choice is force reboot.

Also even if xmr-stak is alive I can't stop it with Ctrl+C, instead it just hangs like above. I need to do more testing and tuning.

@uentity
Copy link
Author

uentity commented Jan 26, 2018

BTW, ethminer works fine, no issues. I havn't run it for a long time though.

@uentity
Copy link
Author

uentity commented Feb 14, 2018

UPDATE: actually it was my power supply issue that caused all these hangs and strange behaviour.
Fixed it and now I can report that Vega is mining stable under your mesa3d-comp-bridge!

BTW: I can get ~1200 H/s with xmr-stak and this PR applied. Got this result with intensity = 3840.

@uentity uentity closed this as completed Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants