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

Invalid Results with RX480 [AMDGPU] #1825

Open
notmike-5 opened this issue Sep 14, 2018 · 15 comments
Open

Invalid Results with RX480 [AMDGPU] #1825

notmike-5 opened this issue Sep 14, 2018 · 15 comments

Comments

@notmike-5
Copy link

notmike-5 commented Sep 14, 2018

Please provide as much as possible information to reproduce the issue.

Like others I am having a problem with AMD GPU results. All or most of the results from my GPU are invalid. I am getting maybe 30% valid results and I think those are from the CPU. I have been unable to find the AMD APP SDK v3.0 for Linux. I was able to find https://sourceforge.net/projects/nicehashsgminerv5viptools/files/APP%20SDK%20A%20Complete%20Development%20Platform/ but it doesn't seem like this installed the correct version or I am pointing at the wrong place in compilation. Appreciate any help getting back up and running.

@Spudz76
Copy link
Contributor

Spudz76 commented Sep 14, 2018

New drivers don't work, they changed out the compiler which breaks our OpenCL kernels (fix pending in #1797)

Unsure which version was the last to actually work correctly on Windows, but I think it was somewhere around 18.2.x.

Last version of AMD APP SDK 3.0 for Windows available here from before they dropped it from their website

@MrKalipo
Copy link

MrKalipo commented Sep 19, 2018

I got same error now found a solution to get it without error! Run latest 18.9.1 everything OK!

Add this to regedit:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4d36e968-e325-11ce-bfc1-08002be10318}\0001]
"KMD_EnableInternalLargePage"=dword:00000002

Restart PC. Big thanks to @mutl3y!!

@psychocrypt
Copy link
Collaborator

Please check if #1866 solved you issue

@notmike-5
Copy link
Author

notmike-5 commented Oct 11, 2018

At first glance this appeared to have worked. Hashrate report showed an increased hashrate, but results are still only ~33% valid. Only marginally effective with RX480, if at all.

@leve1ord
Copy link

Had the same problem with my rx580. Use xmr-stak 2.5.0 to fix this issue.

@notmike-5
Copy link
Author

notmike-5 commented Oct 19, 2018

Built 2.5.0 and 2.5.1, ran and generated new configs. Still getting high error rate from GPU. Its actually a higher error rate than before.

@Spudz76
Copy link
Contributor

Spudz76 commented Oct 19, 2018

You no longer need the SDK which is why it is tough to find. AMD says nobody needs it. We only used it for the headers...
Now you get OpenCL headers from Khronos directly over here and put them somewhere CMake can find them (I prefer to just chuck them in /usr/include/CL where they normally go)
The library comes with the driver, we never actually used the libraries that came with the other 300MB of SDK.

@Spudz76
Copy link
Contributor

Spudz76 commented Oct 19, 2018

^^^ do not use the distro provided opencl-headers or opencl-dev they are broken and will overwrite the manually placed copy from official upstream, if you install systemwide as suggested above

@Spudz76
Copy link
Contributor

Spudz76 commented Oct 19, 2018

Also the current release CMakeLists.txt is not patched to define what OpenCL version to target, but I believe it selects 2.2 which ends up working fine anyway on any sort of new card and driver. Best to define CL_TARGET_OPENCL_VERSION though as it says in their readme. And for older cards/drivers it likely must be set to #define CL_TARGET_OPENCL_VERSION 120 to force 1.2 modes (library has no 2.x features)

I have CMake PR (#1853) that does all this "better header compatibility" but bundled with a ton of other serious heavy refactoring (that probably breaks someone's something - but works for me), have to split them out more atomic so they can be accepted.

@Spudz76
Copy link
Contributor

Spudz76 commented Oct 19, 2018

^^^ that PR is not rebased to current dev, either, it is a little stale (don't compile from it...)

@notmike-5
Copy link
Author

notmike-5 commented Oct 31, 2018

Where do I place #define CL_TARGET_OPENCL_VERSION 120 exactly? I tried a few places but it is both not finding /usr/include/CL and is still defaulting to version 2.2. When i run cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=ON -DOpenCL_LIBRARY=/usr/include/CL it finds the library, sort of, but the output is

$ cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=ON -DOpenCL_LIBRARY=/usr/include/CL .. -- Found OpenCL: /usr/include/CL (found version "2.2") -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found OpenSSL: /usr/lib/libcrypto.so (found version "1.1.1") -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- Configuring done WARNING: Target "xmrstak_opencl_backend" requests linking to directory "/usr/include/CL". Targets may link only to libraries. CMake is dropping the item. -- Generating done -- Build files have been written to:

It builds, giving the same error about version...

cpp:38: /usr/include/CL/cl_version.h:34:104: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2) on.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")

and when I run the miner it tells me about an undefined symbol...

xmr-stak: symbol lookup error: ./libxmrstak_opencl_backend.so: undefined symbol: clGetPlatformIDs

Still, feels close to a good solution. Not sure where I'm erring.

@Spudz76
Copy link
Contributor

Spudz76 commented Nov 1, 2018

OpenCL_LIBRARY is for the .so file
OpenCL_INCLUDE_DIR is for the .h files path
More like:

cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=ON -DOpenCL_INCLUDE_DIR=/usr/include -DOpenCL_LIBRARY=/opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so

RX series should be fine with not setting CL_TARGET_OPENCL_VERSION the AMD driver supports 2.2 (at least the features we use). You would add a line to CMakeLists.txt near line 292:

    if(OpenCL_FOUND)
        list(APPEND BACKEND_TYPES "amd")
        include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
        #set(LIBS ${LIBS} ${OpenCL_LIBRARY})
        link_directories(${OpenCL_LIBRARY})
        add_definitions("-DCL_TARGET_OPENCL_VERSION=120")
    else()
        message(FATAL_ERROR "OpenCL NOT found: use `-DOpenCL_ENABLE=OFF` to build without OpenCL support for AMD gpu's")
    endif()

@Spudz76
Copy link
Contributor

Spudz76 commented Nov 1, 2018

But again locking version to 1.2 (120) is not needed unless it's an old card.

Old like HD5xxx/7xxx pre Islands definite not with RX or even most R9

@notmike-5
Copy link
Author

notmike-5 commented Nov 1, 2018

So my distro is unsupported for AMDGPU-PRO driver (according to wiki). I can install AMDGPU and the SDK, but that setup appears no longer working. This is sort of at the core of my issue, I believe.

@notmike-5
Copy link
Author

I have installed opencl-amd from the AUR and latest version of xmr-stak

Built with cmake -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=ON -DOpenCL_INCLUDE_DIR=/usr/include -DOpenCL_LIBRARY=/opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so

No issues compiling, AMD backend builds, but all the AMD results are invalid.

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

5 participants