How to installing OpenCL for lightweight ETH mining on mesa driver environment in Ubuntu.

in #linux7 years ago (edited)

FIRST OF ALL:

1. NO GUARANTEES

2. DONT TELL ME I BROKE YOUR SYSTEM (see 1.)

3. THIS IS A COMPILATION OF SEVERAL DIFFERENT SOURCES(i dont take credit! There are several awesome people in the linux community and i cant credit them all :D)

4. NO GUARANTEES, NO ANYTHING IF YOU DONT KNOW WHAT YOUR DOING STOP BEFORE YOU START.


Now about the why:

Since im using a self build kernel from the git my system doesnt play nice with dkms modules which the official driver relies on. Normaly the module wont build in such an environment and leave you without a system that boots to a black screen.

So for people that might want to use opensource drivers with the amdgpu-pro opencl with the 1.2 capabilitys i wrote down the steps i took.

Please consider i used this with an RX480 8GB in combination with the cpp-ethereum miner build from git and had plenty of crashes while setting up the system(getting miner values right). Once you start a miner with wrong paramenters your screen will just plain lock up.


Step 0:

So starting out on a clean ubuntu install(17.04)


Step 1:

After installing the ppa's for latest mesa drivers from oibaf + paulo-miguel-dias and updating the system and installing mesa opencl capabilitys:


sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo add-apt-repository ppa:paulo-miguel-dias/mesa
sudo apt update
sudo apt install mesa-opencl-icd


Step 2:

Download the latest amdgpu-pro driver package provided by amdgpu AMD

unpack the package and find the 64bit versions of:


opencl-amdgpu-pro-icd().deb
libdrm-amdgpu-pro-amdgpu().deb
libdrm2-amdgpu-pro().deb
libopencl1-amdgpu-pro().deb

unpack these packages and place the files in the following directorys:


/etc/OpenCL/vendors/

├── amdocl64.icd(provided by opencl-amdgpu-pro-icd)

└── mesa.icd(gets installed by mesa)


/opt/amdgpu-pro/lib64/

├── libamdocl12cl64.so (provided by opencl-amdgpu-pro-icd)

├── libamdocl64.so(provided by opencl-amdgpu-pro-icd)

├── libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0(provided by libdrm-amdgpu-pro-amdgpu)

├── libdrm_amdgpu.so.1.0.0(provided by libdrm-amdgpu-pro-amdgpu)

├── libdrm.so.2 -> libdrm.so.2.4.0(provided by libdrm2-amdgpu-pro)

├── libdrm.so.2.4.0(provided by libdrm2-amdgpu-pro)

├── libkms.so.1 -> libkms.so.1.0.0(provided by libdrm2-amdgpu-pro)

├── libkms.so.1.0.0(provided by libdrm2-amdgpu-pro)

├── libOpenCL.so -> libOpenCL.so.1(provided by libopencl1-amdgpu-pro)

└── libOpenCL.so.1(provided by libopencl1-amdgpu-pro)


Step 3:

I used these ethereum environment flags to run the miner with:

export GPU_FORCE_64BIT_PTR=1
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100

Step 4 (PROFIT):

to execute a program with opencl 1.2 you need to prefix on the console:


LD_LIBRARY_PATH=/opt/amdgpu-pro/lib64

There is no need to reboot the system to launch applications after setting the system with opencl up like this but also the typical features such as overlocking and such are less supported(supported like in mesa drivers).


Example: 

$LD_LIBARY_PATH=/opt/amdgpu-pro/lib64 ~/cpp-ethereum/ethminer -G -S POOLADDRESS -O USERNAME --cl-local-work 128 --cl-global-work 4096 --cl-extragpu-mem 1000 --verbosity 2 -t 32


With this setup i could get up to ~25MH/s and still use the system in multimonitor setup for daily tasks.

I hope if you read this far that you found this interesting or entertaining :D dont forget to leave a upvote.

Sort:  

Congratulations @woojoo! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments
Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @woojoo! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @woojoo! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got your First payout

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

YOU BROKE MY SYSTEM!

J/K. Great writeup, thanks!

Congratulations @woojoo! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last announcement from @steemitboard!

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @woojoo! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!