Contribute
Register

How to Enable OpenCL on Nvidia GeForce GTX 680 4GB kepler - HACKINTOSH GUIDE

Status
Not open for further replies.
Joined
Jun 8, 2011
Messages
12
Motherboard
Hackintosh
CPU
i7 2600k
Graphics
Nvidia GeForce GTX 470
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. 0
How to Enable OpenCL on Nvidia GeForce GTX 670 or 680 4GB kepler GPU - HACKINTOSH GUIDE

This is the only way I have figured out to get OpenCL to work on the GTX 680 with 4GB of VRAM. My friend (who wishes to remain anonymous) is the one who came up with the idea to modify the permissions and Netkas figured out how to do the hex edits. I take no credit for this guide other than writing it and successfully using the methods that I describe. I have tested this on 2 systems and it works like a charm. I tested it with one X79 LGA 2011 Hackintosh and one Z77 LGA 1155. You must do everything in the EXACT right order or you will receive an irreparable kernel panic upon reboot after completion. Therefore I STRONGLY RECOMMEND that you have a Time Machine Backup or CCC backup of your system before attempting the following. I am not responsible if your installation is killed because I told you to do a backup and because if it fails then you likely did not follow the instructions exactly.

Here is a video tutorial that I made to demonstrate how to do this in Mac OS 10.8.2:
http://youtu.be/GG-uOGjmSt4

In this guide we will be enabling OpenCL on the GTX 680 4GB version. For the 2GB version of the GTX 680, just use MultiBeast. Essentailly, what we will be doing is replacing the libclh.dylib file AND the hex edited OpenCL file. Then repair disk permissions. Then restart and do the CUDA fix (if necessary). Here is how to replace the libclh file:

If you don't already have a Hex Editor application then you can download Hex Fiend from: http://ridiculousfish.com/hexfiend/

1) If you are using the native drivers in version 10.8.0 and 10.8.1 then you will need to download the file "libclh.dylib" patched kext from http://rghost.net/39181502

If you are using 10.8.2 and the corresponding NVidia Drivers (304.00.05f02), then you will need the to patch the libclh.dylib kext using this method by robertx: http://www.insanelymac.com/forum/to...0-cards-aka-ccsm-21/page__st__80#entry1852666
If you don't want to follow the link and read for yourself, all you have to do is paste the following code in Terminal, verify it with your password, and take pleasure knowing that your nvidia graphics driver was successfully patched as long is it said that there were substitutions made. Here is the Terminal code as outlined by RobertX from the link above:

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

Do not copy the above sudo command from here because it may not work due to the way it is formatted. I recommend following the link above and copying it from RobertX.

Then, run disk permission repair and restart. You have patched the nvidia graphics driver so you can skip steps 2 through 5 and move on to learn about how to patch your openCL.

If you are not on 10.8.2, then continue to steps 2 through 5 to continue patching the nvidia graphics driver.

2) Navigate to /System/Library/Extensions and find the file "GeForceGLDriver.bundle"

3) Right click on this file and select "Show Package Contents"

4) Select "Contents" then "Mac OS" and you will find the original "libclh.dylib" file. Rename this "libclhBAK.dylib"

5) Copy the new "libclh.dylib" file you just downloaded, enter your password and restart your computer. Done!

Note, the previous step does not cause issues. However, replacing the Hex edited OpenCL file in the next portion of this guide will cause a bad kernel panic if you do it wrong so follow along closely! The only fix I have found if you did it wrong and get the kernel panic is to use another Hackintosh to load your OS drive and replace the hex edited OpenCL file with the original version. SO MAKE A BACKUP of the original OpenCL file if you want to be able to perform this "surgery" fix.

BEFORE you replace the hex edited OpenCL file in Mac SSD/system/library/frameworks/openclframework/versions/A. You must open disk utility and get it ready to get to the screen where you can repair disk permissions on Mac SSD. If you don't do this first, then you won't be able to open disk utility after replacing the OpenCL file.

Copy Hex Fiend to applications folder

Add your Admin user to the group by opening Terminal and pasting:
sudo dseditgroup -o edit -a White -t user wheel
In this case White is the Admin User name. SUBSTITUTE AS NECESSARY. If you don't know what the name of your admin user account is then go open your installation drive, click on Users, and next to the icon that looks like a home is your user name. Copy it exactly because it is case sensitive.

Pull up get info on both the "A" parent folder and the "OpenCL" file. Twirl down Sharing & Permissions and unlock both (enter password when prompted).

Change the wheel permissions for the OpenCL file to Read &Write (instead of it's original state of read only). This will allow you to save the hex edit changes that you are about to make.

Right click on the OpenCL file and select open with Hex Fiend.

Select Edit>Find (or cmd+f) to bring up find and replace window.
Type in the following codes (NO COPY PASTING!) Make sure to use REPLACE ALL.
find: ff 50 68 4c 39 e0 73 e7
replace: ff 50 68 4c 39 e0 90 90

After you've made the proper Hex edits, you must then adjust the permissions of the folder back to its original state of system=Read & Write, wheel=Read only, everyone=Read only. Click on the preference wheel (near the bottom left) of the A folder within the get info window and select Apply to enclosed items.

Then repair disk permissions.

Restart. Note: Everything must be done in this exact right order or it will not work.


This is the forum on how to fix CUDA after getting OpenCL to work. Check to see if your CUDA is working by running a Cinebench GPU test. You may not even have to do this next part because there may already be a file named libcuda_295.30.00.dylib. I never had to do this on my systems but just in case the libcuda_295.30.00.dylib file is not there, this is how you do it.
I learned this from the netkas forum:
http://forum.netkas.org/index.php?topic=2793.0

It's basically just this to reenable CUDA:
Easy Breezy

If you are running GM but CUDA isn't working even though you have 4.1.29

Go to /Library/Frameworks/CUDA.framework/Versions/A/Libraries

duplicate "libcuda_295.10.15.dylib"

and then name it:

libcuda_295.30.00.dylib

don't even need to restart, CUDA will just work



Now that you are all set and you rebooted successfully back into your system. Check your OpenCL performance by using OpenCL_OceanWave (I have attached it to this post because it is hard to find online) or LuxMark applications.

Please let me know if my guide helped you or if you are having issues. Thanks!!
-Brandon
 

Attachments

  • OpenCL_OceanWave.zip
    3.5 MB · Views: 1,048
does it work with last drivers from nvidia???
 
I have not tested it with the new Nvidia drivers for 10.8.2. I have only tested it on the stock 10.8.2 drivers.

You should do a backup, give it a whirl, and report your findings back on this thread. I would be very interested to hear the results.

Make sure that with the new Nvidia Drivers you set GraphicsEnabler=No in your plist (or by unchecking the box in Chameleon Wizard, which automatically edits your plist in the same way).
 
Make sure that with the new Nvidia Drivers you set GraphicsEnabler=Yes in your plist (or by checking the box in Chameleon Wizard, which automatically edits your plist in the same way).

GraphicsEnabler must be No for GTX680 cards. Nvidia series 600 cards are native supported by OSX 10.8.2.
 
I'm running an EVGA GTX 680 FTW+ with 4GB VRAM.

Your tips worked for me, except I did it with 10.8.2 and the corresponding NVidia Drivers (304.00.05f02). So I needed a new libclh.dylib patch, which was found here.

Patch of OpenCL Framework worked as your described. OpenCL_OceanWave and CUDA-Z are report both working.

Thanks very much!
 
@khe91
"GraphicsEnabler must be No for GTX680 cards. Nvidia series 600 cards are native supported by OSX 10.8.2."

You are correct. Thanks.
 
I'm running an EVGA GTX 680 FTW+ with 4GB VRAM.

Your tips worked for me, except I did it with 10.8.2 and the corresponding NVidia Drivers (304.00.05f02). So I needed a new libclh.dylib patch, which was found here.

Patch of OpenCL Framework worked as your described. OpenCL_OceanWave and CUDA-Z are report both working.

Thanks very much!

I'm glad it helped you! Thanks for testing it with 10.8.2 and figuring out that it needs a different libclh.dylib patch!!
 
nvcap always the same..?

"NVCAP",
Buffer (0x14)
{
/* 0000 */ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
/* 0008 */ 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E,
/* 0010 */ 0x00, 0x00, 0x00, 0x00

how to change the nvcap?
 
Thanks for the post, before I got started I had a couple questions that I was hoping you guys could help with:
1. I am unable to download the nvidia drivers because of an error: invalid checksum
2. Where can I download openCL ocean wave? I was able to find CUDA-z (which I ran and it stated "cuda not found")

I just gave up on the audio for now otherwise I was going to throw the computer out the window. Unfortunatley this seems tougher...might be spare computer parts all over the road in bk tonight...

Thanks
 
Status
Not open for further replies.
Back
Top