Bitcoin Forum
November 02, 2024, 03:16:11 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Workaround for Nvidia OpenCL 100% CPU usage on linux.  (Read 1925 times)
Misiolap (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 20, 2013, 10:07:41 AM
 #1

Little workaround for nvidia eating 100% CPU when running OpenCL apps on linux.

Download link:

http://mk.junkyard.one.pl/libsleep.c

To compile run:
gcc -O2 -fPIC -shared -Wl,-soname,libsleep.so -o libsleep.so libsleep.c

To use:
LD_PRELOAD="./libsleep.so" ./cgminer

You can configure sleep time by setting
YIELD_SLEEP_TIME environment variable (in microseconds)
Default is 1000usec
Example:
YIELD_SLEEP_TIME="1500" LD_PRELOAD="./libsleep.so" ./cgminer

How does it work:
It overrides sched_yield function called during running OpenCL program with call to usleep.
Expect a little performance drop (less than 5%) - adjust YIELD_SLEEP_TIME for your needs.
The longer opencl program running time (ie. higher agression), the lower the performance drop is.

Does someone who is affected by similar problem with ATI cards would be willing to give me access to their system, so i could look up how to resolve this issue with ATI?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!