Bitcoin Forum
June 27, 2022, 03:48:40 PM *
News: Latest Bitcoin Core release: 23.0 [Torrent]
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: Workaround for Nvidia OpenCL 100% CPU usage on linux.  (Read 1899 times)
Offline Offline

Activity: 14
Merit: 0

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

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

Download link:

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

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

You can configure sleep time by setting
YIELD_SLEEP_TIME environment variable (in microseconds)
Default is 1000usec
YIELD_SLEEP_TIME="1500" LD_PRELOAD="./" ./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]
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!