ethereum-mining / ethminer

Ethereum miner with OpenCL, CUDA and stratum support
GNU General Public License v3.0
5.96k stars 2.28k forks source link

SIGSEGV encountered on Arch Linux with AMD 5600 XT GPU #2155

Open thomasjsweet opened 3 years ago

thomasjsweet commented 3 years ago

Describe the bug Unable to run ethminer due to segmentation fault with either opencl-mesa or opencl-amd

To Reproduce Clone latest source code Configure with cmake .. -DETHASHCUDA=OFF -DUSE_SYS_OPENCL=ON -DHUNTER_ENABLED=ON Compile successfully Run: --> ethminer -G -P stratum+tcp://redactedUser.1:x@us-east.ethash-hub.miningpoolhub.com:20535

Expected behavior no segmentation fault

Actual result

ethminer 0.19.0-17+commit.ce52c740
Build: linux/release/gnu

 i 12:58:01 ethminer Configured pool us-east.ethash-hub.miningpoolhub.com:20535
 i 12:58:01 ethminer Selected pool us-east.ethash-hub.miningpoolhub.com:20535
 i 12:58:02 ethminer Stratum mode : Stratum
 i 12:58:02 ethminer Established connection to us-east.ethash-hub.miningpoolhub.com [18.204.40.75:20535]
 i 12:58:02 ethminer Spinning up miners...
cl 12:58:02 cl-0     no exit option enabled for non AMD opencl device
cl 12:58:02 cl-0     OpenCL OpenCL 1.1 Mesa 20.3.4 not supported, but platform Clover might work nevertheless. USE AT OWN RISK!
cl 12:58:02 cl-0     Using Device :  AMD Radeon RX 5600 XT (NAVI10, DRM 3.40.0, 5.10.14-arch1-1, LLVM 11.0.1) OpenCL 1.1 Mesa 20.3.4 Memory : 6.00 GB (6442450944 B)
cl 12:58:02 cl-1     Using Device : 0b:00.0 gfx1010 OpenCL 2.0  Memory : 5.98 GB (6425673728 B)
 i 12:58:02 cl-1     Adjusting CL work multiplier for 18 CUs. Adjusted work multiplier: 32,768
 i 12:58:02 ethminer Epoch : 395 Difficulty : 12.88 Gh
 i 12:58:02 ethminer Job: 738210a6… us-east.ethash-hub.miningpoolhub.com [18.204.40.75:20535]
cl 12:58:03 cl-0     Generating split DAG + Light (total): 4.09 GB
 i 12:58:03 ethminer Authorized worker redacted.1
cl 12:58:03 cl-1     Generating split DAG + Light (total): 4.09 GB
cl 12:58:03 cl-0     OpenCL kernel
 X 12:58:03 cl-0     OpenCL kernel build log:
fatal error: cannot open file '/usr/share/clc/gfx1010-amdgcn-mesa-mesa3d.bc': No such file or directory

 X 12:58:03 cl-0     OpenCL kernel build error (-11):
clBuildProgram
SIGSEGV encountered ...
stack trace:
backtrace() returned 7 addresses
./ethminer(+0xa2382) [0x55658d1df382]
/usr/lib/libc.so.6(+0x3cf80) [0x7f2740b1cf80]
./ethminer(+0x353191) [0x55658d490191]
./ethminer(+0x146256) [0x55658d283256]
./ethminer(+0x400f24) [0x55658d53df24]
/usr/lib/libpthread.so.0(+0x9299) [0x7f2740e15299]
/usr/lib/libc.so.6(clone+0x43) [0x7f2740bdf153]
[1]    3395221 segmentation fault (core dumped)  ./ethminer -G -P 
➜  ethminer git:(master) 

Environment (please complete the following information):

lonyelon commented 3 years ago

Same issue, cloned ethminer from the AUR.

Scr0nch commented 3 years ago

I encountered this same crash when using the default mesa driver shipped with Manjaro after installing ethminer from the AUR. After about 10 hours of debugging, the way I fixed it is this:

  1. Install the opencl-amd package from the AUR Note: I encountered a problem where the DAG was never generated using the latest version of this package. Downgrading this package to version 20.40 fixed the issue because, as AMD mentioned in their release notes for 20.45, "User may experience issues when utilizing OpenCL in multimedia use cases." To install the 20.40 version, download the older PKGBUILD file and manually install it. Note 2: compiling ethminer with -DBINKERN=OFF as mentioned in this issue did not fix the issue using version 20.45 of opencl-amd for me.
  2. Find the id of the duplicate graphics card entry created by the AMDGPU proprietary driver by passing --list-devices to ethminer. For me the gfx1010 entry has an id of 1
  3. Add --cl-devices 1 to your ethminer flags where 1 is the id from step 2.
lonyelon commented 3 years ago

I encountered this same crash when using the default mesa driver shipped with Manjaro after installing ethminer from the AUR. After about 10 hours of debugging, the way I fixed it is this:

  1. Install the opencl-amd package from the AUR Note: I encountered a problem where the DAG was never generated using the latest version of this package. Downgrading this package to version 20.40 fixed the issue because, as AMD mentioned in their release notes for 20.45, "User may experience issues when utilizing OpenCL in multimedia use cases." To install the 20.40 version, download the older PKGBUILD file and manually install it. Note 2: compiling ethminer with -DBINKERN=OFF as mentioned in this issue did not fix the issue using version 20.45 of opencl-amd for me.
  2. Find the id of the duplicate graphics card entry created by the AMDGPU proprietary driver by passing --list-devices to ethminer. For me the gfx1010 entry has an id of 1
  3. Add --cl-devices 1 to your ethminer flags where 1 is the id from step 2.

This solved the problem for me.

owendaprile commented 3 years ago

If you install opencl-amd and compile ethminer with -DUSE_SYS_OPENCL=ON you don't need to specify the device (at least for me, and I was having this problem before I did this).