Closed Bliss3d closed 6 years ago
Not sure if this fits your requirements but try https://github.com/StefanOberhumer/ethminer/tree/CL-Own-CL-Library.
To disable CUDA use -DETHASHCUDA=OFF
instead -DCUDA_ENABLE=OFF
I had a question about how ethminer loads the OpenCL apis, without the ICD being explicitly present on the system.
Nevermind, found it. I guess it links the ICD statically https://docs.hunter.sh/en/latest/packages/pkg/OpenCL.html?highlight=OpenCL
And that picks old ICD, since my pull request isnt merged with master yet
If you're playing around with OpenCL-FPGA or OpenCL(explicit for your card) I think the best and easiest way is to adapt CMakeLists.txt in libethash-cl directory. Current ethminer "just" supports default hunter OpenCL implementation.
Dont know if this belongs here, but it seems thats part of our problem with nallatech BSP, the manual says:
6.5.2.2 Switching to the Client Driver (FCD/ICD) Nallatech have supplied the 17.x version of this BSP package installer to not setup the FCD as part of the installation. If you need to use the client driver approach (FCD/ICD):
Guess i ask nallatech first about some clarification what is what and needed when and so on.
Closing... not ethminer issue.
FYI, for anybody trying to build ethminer for ROCm, you can do the following (thanks to @StefanOberhumer's suggestion):
ethminer/libethash-cl/CMakeLists.txt
hunter_add_package(OpenCL)
and find_package(OpenCL CONFIG REQUIRED)
set(OpenCL_INCLUDE_DIR "/opt/rocm/opencl/include/")
set(OpenCL_LIBRARIES "/opt/rocm/opencl/lib/x86_64/libOpenCL.so")
add_library(rocmcl INTERFACE)
target_include_directories(rocmcl INTERFACE ${OpenCL_INCLUDE_DIR})
target_link_libraries(rocmcl INTERFACE ${OpenCL_LIBRARIES})
target_link_libraries(ethash-cl PRIVATE OpenCL::OpenCL)
to target_link_libraries(ethash-cl PRIVATE rocmcl)
Then things should compile properly. But honestly I didn't see any positive difference compared to whatever hunter
did. On the other hand will be very useful if ethminer
provided an easy way to select some particular OpenCL library instead of heavily modifying CMakeLists.txt
.
$ sudo lsof /opt/rocm/opencl/lib/x86_64/libOpenCL.so
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ethminer 12408 user mem REG 253,0 27728 35248619 /opt/rocm/opencl/lib/x86_64/libOpenCL.so.1
P.S. I don't think this nallatech BSP
whatever it means has anything to do with selecting an OpenCL driver except maybe for that particular board.
So I really would like to specify my OpenCL dir/lib when compiling from source. so I used:
cmake .. -DCUDA_ENABLE=OFF -DOpenCL_INCLUDE_DIR=/opt/rocm/opencl/include/ -DOpenCL_LIBRARY=/opt/rocm/opencl/lib/x86_64/libOpenCL.so
However I get this warning:
CMake Warning: Manually-specified variables were not used by the project:
So, the opencl dir/lib I specified were not used to compile - and as a result the miner does not work.