Jump to content

OpenCL fix for non-GF100/GF110 cards (aka CC/SM 2.1+)


  • Please log in to reply
137 replies to this topic

#81
m_coffee

m_coffee

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts
Is there any solution for enabling OpenCL for this new driver from NVIDIA?
I have GT 430 with 1GB memory.

#82
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
...think i've got the fix now...from "the other place"

"Anyway I just wanted to share this patch for libclh.dylib since the old one doesn't work anymore and it's quite frustrating that OpenCL isn't working out of the box so to speak. And it took some time to work it out since Nvidia anonymized the function names in the library.

Just copy and paste this in a terminal window (don't forget to backup libclh.dylib beforehand).


Code:
sudo perl -pi -e '$c+=s/\x8b\x81\x1c\x0c\x00\x00\xeb\x06\x8b\x81\x20\x0c\x00\x00/\xb8\x02\x00\x00\x00\x90\xeb\x06\xb8\x00\x00\x00\x00\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/libclh.dylib
Alternatively you can use a hex editor to search for:
8b 81 1c 0c 00 00 eb 06 8b 81 20 0c 00 00

and replace it by:
b8 02 00 00 00 90 eb 06 b8 00 00 00 00 90

There should be only one occurrence of this in the whole file. The perl script will tell you the number of substitutions it made.

Normally it should take effect immediately so there's no need to reboot, it should also trigger a rebuild of the kernel cache.
If like me you're a cautious person feel free to do those two things manually."
(all credit to this code digger) credit removed

...using the new drivers from nvidia for 10.8.1 i can now run the LuxMark v2.0 benchmark ... :thumbsup_anim:

Attached File  LuxMark v2.0 GT520.png   668.88KB   439 downloads Attached File  GFX.png   271.66KB   410 downloads

Edited by robertx, 07 April 2013 - 06:35 PM.
Link to tonymac removed


#83
m_coffee

m_coffee

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

THANK YOU!!!!
IT IS A PERFECT SOLUTION!!!


Edited by Gringo Vermelho, 17 September 2013 - 10:55 AM.
Fullquote removed. Please don't quote entire posts when replying directly below them.


#84
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
:smoke:...just delivering the news

#85
STLVNUB

STLVNUB

    InsanelyMac Legend

  • Coders
  • 1,143 posts
  • Gender:Male
Don't work for GT640

#86
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
on 10.8.2 now...and again a new patch seems to be required... :worried_anim: ..."a hunting I will go..."

#87
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
for the stock 10.8.2 drivers (8.0.61 295.30.20f02 version) this fix still works

"So, open up a hex editor of your liking and do this:
open /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/libclh.dylib (as root or with sudo)
find: 8B 87 1C 0C 00 00 89 06 8B 87 20 0C 00 00 89 02
replace by: 31 C0 FF C0 FF C0 89 06 31 C0 89 02 90 90 90 90
save
reboot is not required, but recommended" from the first post... :thumbsup_anim:

#88
tora

tora

    InsanelyMac Protégé

  • Members
  • PipPip
  • 58 posts

for the stock 10.8.2 drivers (8.0.61 295.30.20f02 version) this fix still works

"So, open up a hex editor of your liking and do this:
open /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/libclh.dylib (as root or with sudo)
find: 8B 87 1C 0C 00 00 89 06 8B 87 20 0C 00 00 89 02
replace by: 31 C0 FF C0 FF C0 89 06 31 C0 89 02 90 90 90 90
save
reboot is not required, but recommended" from the first post... :thumbsup_anim:


By doing so, OpenCL doesn't work for me.
I'm on OS X 10.8.2 (12C60) and my graphics card is Gigabyte GeForce GTX 560 Ti 1024 MB.
What I am doing wrong?
Greetings and thanks.

#89
tora

tora

    InsanelyMac Protégé

  • Members
  • PipPip
  • 58 posts

By doing so, OpenCL doesn't work for me.
I'm on OS X 10.8.2 (12C60) and my graphics card is Gigabyte GeForce GTX 560 Ti 1024 MB.
What I am doing wrong?
Greetings and thanks.


well,

this script with latest nVidia drivers get back openCL for me

sudo perl -pi -e '$c+=s/\x8b\x81\x1c\x0c\x00\x00\xeb\x06\x8b\x81\x20\x0c\x00\x00/\xb8\x02\x00\x00\x00\x90\xeb\x06\xb8\x00\x00\x00\x00\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/libclh.dylib


#90
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
...good to see people using their heads... :smoke:

#91
aankun.ganteng

aankun.ganteng

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts
  • Gender:Male
  • Location:Bali, Indonesia
Hi, this guide is succesfully enable my openCL :thumbsup_anim:
but when click on oceanwave test the image is having some glitches
(see the bottom of the sun)
is it normal???

Attached File  Screen Shot 2013-04-03 at 8.59.09 AM.png   780.56KB   60 downloads

#92
mitch_de

mitch_de

    InsanelyMacaholic

  • Retired
  • 2,902 posts
  • Gender:Male
  • Location:Stuttgart / Germany

Hi, this guide is succesfully enable my openCL :thumbsup_anim:
but when click on oceanwave test the image is having some glitches
(see the bottom of the sun)
is it normal???

Attached File  Screen Shot 2013-04-03 at 8.59.09 AM.png   780.56KB   60 downloads


No, the rendering is not correct. The waves are missed.
You can try much newer (than 1.2) OceanWave version , but i think (because the OpenCL code wasnt changed) the missing waves will stay.
Such things may happen with some of the subgpu types which not already fully supported by the OpenCL drivers .
to be more excact: to on the fly OpenCL compiler which compiles the source for the found gpu type on the host system. Other than CUDA, which is compiled by the dev already (for several nvidia gpu types) OpenCL used OpenCL source code and compiled it later on run time (first run).

Doesnt matter much, because the complex used OpenCL functions in OceanWave , which fail on your gpu may not used in other OpenCL acceled apps.

#93
aankun.ganteng

aankun.ganteng

    InsanelyMac Protégé

  • Members
  • Pip
  • 34 posts
  • Gender:Male
  • Location:Bali, Indonesia

No, the rendering is not correct. The waves are missed.
You can try much newer (than 1.2) OceanWave version , but i think (because the OpenCL code wasnt changed) the missing waves will stay.
Such things may happen with some of the subgpu types which not already fully supported by the OpenCL drivers .
to be more excact: to on the fly OpenCL compiler which compiles the source for the found gpu type on the host system. Other than CUDA, which is compiled by the dev already (for several nvidia gpu types) OpenCL used OpenCL source code and compiled it later on run time (first run).

Doesnt matter much, because the complex used OpenCL functions in OceanWave , which fail on your gpu may not used in other OpenCL acceled apps.


Thanks for the reply,
anyway a redo all the patch from the beginning
now the rendering is flickering between screenshot #1 and #2
i think it's getting better?

Attached File  Screen Shot 2013-04-04 at 9.18.22 AM.png   486.57KB   8 downloads
Attached File  Screen Shot 2013-04-04 at 9.18.52 AM.png   345.52KB   6 downloads

#94
mitch_de

mitch_de

    InsanelyMacaholic

  • Retired
  • 2,902 posts
  • Gender:Male
  • Location:Stuttgart / Germany
You are on the right way :)

#95
JahRastaMaN

JahRastaMaN

    InsanelyMac Protégé

  • Members
  • PipPip
  • 92 posts
  • Gender:Male
  • Location:Brasil

...think i've got the fix now...from "the other place"

"Anyway I just wanted to share this patch for libclh.dylib since the old one doesn't work anymore and it's quite frustrating that OpenCL isn't working out of the box so to speak. And it took some time to work it out since Nvidia anonymized the function names in the library.

Just copy and paste this in a terminal window (don't forget to backup libclh.dylib beforehand).


Code:
sudo perl -pi -e '$c+=s/\x8b\x81\x1c\x0c\x00\x00\xeb\x06\x8b\x81\x20\x0c\x00\x00/\xb8\x02\x00\x00\x00\x90\xeb\x06\xb8\x00\x00\x00\x00\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/GeForceGLDriver.bundle/Contents/MacOS/libclh.dylib


Thank YOU man! It's works fine for me. i'm using G75VW RS 72 and 10.8.3 and GTX 670m 3GB GDDR5

http://cl.ly/O6ro

#96
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
:smoke:

#97
beta992

beta992

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 338 posts
  • Gender:Male

Thank YOU man! It's works fine for me. i'm using G75VW RS 72 and 10.8.3 and GTX 670m 3GB GDDR5

Patch from robertx was also needed for me on 10.8.3. :D

#98
JahRastaMaN

JahRastaMaN

    InsanelyMac Protégé

  • Members
  • PipPip
  • 92 posts
  • Gender:Male
  • Location:Brasil
Cool Beta992! Edit you signature

#99
RobertX

RobertX

    Yosemite Sam

  • Members
  • PipPipPipPipPipPipPip
  • 572 posts
  • Gender:Not Telling
for the new nvidia "Web" drivers this works for me
...in Terminal type:
sudo perl -pi -e '$c+=s/\x8b\x81\x1c\x0c\x00\x00\xeb\x06\x8b\x81\x20\x0c\x00\x00/\xb8\x02\x00\x00\x00\x90\xeb\x06\xb8\x00\x00\x00\x00\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/GeForceGLDriverWeb.bundle/Contents/MacOS/libclh.dylib
:smoke:

edit: although the fix works, i now get this error in safari while attempting to view the iphone ad...
5/16/13 4:50:36.000 PM kernel[0]: NVDA(Video): Channel exception! exception type = 0x1f = Fifo: MMU Error
5/16/13 4:50:36.000 PM kernel[0]: NVDA(Video): Channel exception! exception type = 0x1f = Fifo: MMU Error
5/16/13 4:50:44.365 PM WebProcess[405]: VADriver: Channel timeout (client), ch = 2
5/16/13 4:50:56.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:51:16.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:51:24.809 PM WebProcess[405]: VADriver: Channel timeout (client), ch = 3
5/16/13 4:51:36.000 PM kernel[0]: NVDA(OpenGL): Channel timeout!
5/16/13 4:51:57.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:52:17.000 PM kernel[0]: NVDA(OpenGL): Channel timeout!
...totally locks up my system...i'll keep hunting

...changed my smbios.plist to MacPro 3.1 and no longer have the channel timeout freeze in safari

Edited by robertx, 17 May 2013 - 12:11 AM.


#100
beta992

beta992

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 338 posts
  • Gender:Male

for the new nvidia "Web" drivers this works for me
...in Terminal type:
sudo perl -pi -e '$c+=s/\x8b\x81\x1c\x0c\x00\x00\xeb\x06\x8b\x81\x20\x0c\x00\x00/\xb8\x02\x00\x00\x00\x90\xeb\x06\xb8\x00\x00\x00\x00\x90/; END { printf "%s: %d substitution%s made.\n",($c==1 ? "Success" : "Error"),$c,(!$c || $c>1 ? "s" : ""); $?=($c!=1); }' /System/Library/Extensions/GeForceGLDriverWeb.bundle/Contents/MacOS/libclh.dylib
:smoke:

edit: although the fix works, i now get this error in safari while attempting to view the iphone ad...
5/16/13 4:50:36.000 PM kernel[0]: NVDA(Video): Channel exception! exception type = 0x1f = Fifo: MMU Error
5/16/13 4:50:36.000 PM kernel[0]: NVDA(Video): Channel exception! exception type = 0x1f = Fifo: MMU Error
5/16/13 4:50:44.365 PM WebProcess[405]: VADriver: Channel timeout (client), ch = 2
5/16/13 4:50:56.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:51:16.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:51:24.809 PM WebProcess[405]: VADriver: Channel timeout (client), ch = 3
5/16/13 4:51:36.000 PM kernel[0]: NVDA(OpenGL): Channel timeout!
5/16/13 4:51:57.000 PM kernel[0]: NVDA(Video): Channel timeout!
5/16/13 4:52:17.000 PM kernel[0]: NVDA(OpenGL): Channel timeout!
...totally locks up my system...i'll keep hunting

Safari is buggy for me to.. using Chrome as browser now. No freezes, although I'm using the DP3 kexts.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy