todxx / teamredminer

AMD GPU Optimized Cryptocurrency Miner
960 stars 205 forks source link

VEGA64 Failed to initialize device idx 0 (-13) #296

Open plasticbomb1986 opened 3 years ago

plasticbomb1986 commented 3 years ago

System: ArchLinux 5.11.15-zen1-2-zen using the aur package opencl-amd what just updated to 21.10

./teamredminer --list_devices: Team Red Miner version 0.8.1.1 [2021-04-21 15:53:17] Auto-detected AMD OpenCL platform 0 [2021-04-21 15:53:17] Detected 2 devices, listed in pcie bus id order: [2021-04-21 15:53:17] Miner Platform OpenCL BusId Name Model Nr CUs [2021-04-21 15:53:17] ----- -------- ------ -------- ------------- ------------------------- ------ [2021-04-21 15:53:17] 0 0 0 0c:00.0 gfx900 Vega 10 XL/XT [Radeon RX 64 [2021-04-21 15:53:17] 1 0 1 0f:00.0 gfx900 Vega 10 XL/XT [Radeon RX 64

when i try to start eth mining:

./teamredminer -a ethash -o stratum+tcp://eth-eu1.nanopool.org:9999 -u xxxxxxx.GPUs/xxxxx@xxxxx.com -p x --log_file --debug

      Team Red Miner version 0.8.1.1

[2021-04-21 15:52:53] Pool eth-eu1.nanopool.org: Nanopool ethash auto mode detected, setting --eth_stratum=ethproxy [2021-04-21 15:52:53] Auto-detected AMD OpenCL platform 0 [2021-04-21 15:52:53] Initializing GPU 0. [2021-04-21 15:52:53] Failed to initialize device idx 0 (-13) [2021-04-21 15:52:53] Successful clean shutdown.

this error occured right after updating to 21.10 amd packages. Tested with LuxRenderv3.1 and v4 and Blender, all three of them are working and using the GPUs.

t56k commented 3 years ago

Rolling back the Radeon drivers is the quick fix. Use your AUR helper to download the PKGBUILD and the .SRCINFO and make the changes listed here, then run paru -Ui or your equivalent to build and install locally. Here are the relevant files if you don't wanna read through the commits.

.SRCINFO

pkgbase = opencl-amd
        pkgdesc = OpenCL userspace driver as provided in the amdgpu-pro driver stack. This package is intended to work along with the free amdgpu stack.
  pkgver = 20.50.1234664
  pkgrel = 5
        url = http://www.amd.com
        arch = x86_64
        license = custom:AMD
        makedepends = wget
        depends = libdrm
        depends = ocl-icd
        depends = gcc-libs
        depends = numactl
        optdepends = clinfo
        provides = opencl-driver
        conflicts = rocm-opencl-runtime
  source = https://drivers.amd.com/drivers/linux/amdgpu-pro-20.50-1234664-ubuntu-20.04.tar.xz
  sha256sums = 0ffbd907c3243e85b1c9696fe9a7ebb448da8f0f1c54a666489e7da54b1179e7

pkgname = opencl-amd

PKGBUILD

# Maintainer: Carson Rueter <roachh at proton mail dot com>
# Co-Maintainer: George Sofianos
# Contributor: Christopher Snowhill <kode54 at gmail dot com>
# Contributor: ipha <ipha00 at gmail dot com>
# Contributor: johnnybash <georgpfahler at wachenzell dot org>
# Contributor: grmat <grmat at sub dot red>

prefix='amdgpu-pro-'
postfix='-ubuntu-20.04'
major='20.50'
minor='1234664'
amdver='2.4.100'
shared="opt/amdgpu-pro/lib/x86_64-linux-gnu"
shared2="opt/amdgpu/lib/x86_64-linux-gnu"
tarname="${prefix}${major}-${minor}${postfix}"

pkgname=opencl-amd
pkgdesc="OpenCL userspace driver as provided in the amdgpu-pro driver stack. This package is intended to work along with the free amdgpu stack."
pkgver=${major}.${minor}
pkgrel=5
arch=('x86_64')
url='http://www.amd.com'
license=('custom:AMD')
makedepends=('wget')
depends=('libdrm' 'ocl-icd' 'gcc-libs' 'numactl')
conflicts=('rocm-opencl-runtime')
provides=('opencl-driver')
optdepends=('clinfo')

DLAGENTS='https::/usr/bin/wget --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-50 -N %u'

source=("https://drivers.amd.com/drivers/linux/$tarname.tar.xz")
sha256sums=('0ffbd907c3243e85b1c9696fe9a7ebb448da8f0f1c54a666489e7da54b1179e7')

package() {
        mkdir -p "${srcdir}/opencl"
        cd "${srcdir}/opencl"

        # roc*
        ar x "${srcdir}/$tarname/opencl-rocr-amdgpu-pro_${major}-${minor}_amd64.deb"
        tar xJf data.tar.xz
        ar x "${srcdir}/$tarname/rocm-device-libs-amdgpu-pro_1.0.0-${minor}_amd64.deb"
        tar xJf data.tar.xz
        ar x "${srcdir}/$tarname/hsa-runtime-rocr-amdgpu_1.2.0-${minor}_amd64.deb"
        tar xJf data.tar.xz
        ar x "${srcdir}/$tarname/hsakmt-roct-amdgpu_1.0.9-${minor}_amd64.deb"
        tar xJf data.tar.xz
        ar x "${srcdir}/$tarname/hip-rocr-amdgpu-pro_${major}-${minor}_amd64.deb"
        tar xJf data.tar.xz

        # comgr
        ar x "${srcdir}/$tarname/comgr-amdgpu-pro_1.9.0-${minor}_amd64.deb"
        tar xJf data.tar.xz

        # orca
        ar x "${srcdir}/$tarname/opencl-orca-amdgpu-pro-icd_${major}-${minor}_amd64.deb"
        tar xJf data.tar.xz

        cd ${shared}
        sed -i "s|libdrm_amdgpu|libdrm_amdgpo|g" libamdocl-orca64.so

        mkdir -p "${srcdir}/libdrm"
        cd "${srcdir}/libdrm"
        ar x "${srcdir}/$tarname/libdrm-amdgpu-amdgpu1_${amdver}-${minor}_amd64.deb"
        tar xJf data.tar.xz
        cd ${shared2}
        rm "libdrm_amdgpu.so.1"
        mv "libdrm_amdgpu.so.1.0.0" "libdrm_amdgpo.so.1.0.0"
        ln -s "libdrm_amdgpo.so.1.0.0" "libdrm_amdgpo.so.1"

        mv "${srcdir}/opencl/etc" "${pkgdir}/"
        mkdir -p ${pkgdir}/usr/lib
        # roc*
        mv "${srcdir}/opencl/${shared}/libamdocl64.so" "${pkgdir}/usr/lib/"
        mv "${srcdir}/opencl/${shared}/libamd_comgr.so.1.9.0" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared}/libamdhip64.so.4.0.21115-" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared}/libamdhip64.so" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared}/libamdhip64.so.4" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared}/libhsa-runtime64.so.1.2.0" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared}/libhsa-runtime64.so.1" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared2}/libhsakmt.so.1.0.6" "${pkgdir}/usr/lib"
        mv "${srcdir}/opencl/${shared2}/libhsakmt.so.1" "${pkgdir}/usr/lib"

        # comgr
        cd ${srcdir}/opencl/${shared}
        ln -s "libamd_comgr.so.1.9.0" "libamd_comgr.so"
        mv "${srcdir}/opencl/${shared}/libamd_comgr.so" "${pkgdir}/usr/lib/"
        mv "${srcdir}/opencl/${shared}/libamd_comgr.so.1" "${pkgdir}/usr/lib/libamd_comgr.so"

        # orca
        mv "${srcdir}/opencl/${shared}/libamdocl-orca64.so" "${pkgdir}/usr/lib/"
        mv "${srcdir}/opencl/${shared}/libamdocl12cl64.so" "${pkgdir}/usr/lib/"
        mv "${srcdir}/libdrm/${shared2}/libdrm_amdgpo.so.1.0.0" "${pkgdir}/usr/lib/"
        mv "${srcdir}/libdrm/${shared2}/libdrm_amdgpo.so.1" "${pkgdir}/usr/lib/"

        mkdir -p "${pkgdir}/opt/amdgpu/share/libdrm"
        cd "${pkgdir}/opt/amdgpu/share/libdrm"
        ln -s /usr/share/libdrm/amdgpu.ids amdgpu.ids

        mv "${srcdir}/opencl/opt/amdgpu-pro" "${pkgdir}/opt"

        rm -r "${srcdir}/opencl"
        rm -r "${srcdir}/libdrm"
}
yamabiiko commented 3 years ago

Same issue after upgrading opencl-amd to 21.10 on a 5700XT (Arch linux).

castelblends commented 3 years ago

Windows 10. Vega64. I've just updated Radeon software v21.4.1, same error.

Updated TRM to v0.8.2.1 and it is working again.

austinbutler commented 3 years ago

Relatively easy rollback for Arch:

git clone https://aur.archlinux.org/opencl-amd.git/
cd opencl-amd
git checkout ef49efa
makepkg -si
ghost commented 3 years ago

Hi,

Same problem with vega 56 on ubuntu 20.04

Ethminer works perfectly but teamredminer return "Failed to initialize device idx 0 (-13)"

sam@sam-Z390-M-GAMING:~$ clinfo Number of platforms 1 Platform Name AMD Accelerated Parallel Processing Platform Vendor Advanced Micro Devices, Inc. Platform Version OpenCL 2.0 AMD-APP (3246.0) Platform Profile FULL_PROFILE Platform Extensions cl_khr_icd cl_amd_event_callback Platform Extensions function suffix AMD

Platform Name AMD Accelerated Parallel Processing Number of devices 1 Device Name gfx900 Device Vendor Advanced Micro Devices, Inc. Device Vendor ID 0x1002 Device Version OpenCL 2.0 Driver Version 3246.0 (HSA1.1,LC) Device OpenCL C Version OpenCL C 2.0 Device Type GPU Device Board Name (AMD) Vega 10 XL/XT [Radeon RX Vega 56/64] Device Topology (AMD) PCI-E, 03:00.0 Device Profile FULL_PROFILE Device Available Yes Compiler Available Yes Linker Available Yes Max compute units 56 ...