This is the first article in a series that I will write about on the topic of parallel programming and CUDA. In this guide I will explain how to install CUDA 6.0 for Mac OS X. CUDA is a proprietary programming language developed by NVIDIA for GPU programming, and in the last few years it has become the standard for GPU computing. GPU computing is a new branch of computer science and, more specifically, of parallel computing.
I will cover parallel computing in detail in later articles, but if I had to outline in a few words what parallel computing is I would say that it is the partition of repetitive (and therefore often time consuming) tasks into singular tasks, each of which is performed by a single core or processing unit.
MAC OS X UPDATE GPU DRIVER (macos2040.zip) Download Now MAC OS X UPDATE GPU DRIVER In order to run Mac OS X Applications that leverage the CUDA architecture of certain NVIDIA graphics cards, users will need to download and install the 6.5.18 driver for Mac located here. CUDA® is a parallel computing platform and programming model developed by NVIDIA for general computing on graphical processing units (GPUs). With CUDA, developers are able to dramatically speed up computing applications by harnessing the power of GPUs. In GPU-accelerated applications, the sequential part of the workload runs on the CPU – which is optimized for single-threaded performance.
To better explain the key concept behind parallel computing, let me give you a more 'realistic' example. You have to move to a new town and are looking to hire a furniture mover company. You have two choices: the first company can provide you with the strongest man alive driving the world's fastest van. The second one instead has 5 normal men available, each of them with a van of average speed. What would you prefer? Of course it depends of how much stuff you have to move and how much time you have to do it.
If you need the work done quickly and have to move a lot of furniture, of course you will chose the second company. Each of the men is much slower than the strong guy, but if they are able to transport your load concurrently they will have the time to complete the task, have a beer together and come back to their family before the strong guy has done half the work. GPU computing is like having hundreds and thousands of skinny guys with old vans, which can be pretty effective.
This is the main idea about parallel computing. What follows are the instructions to install the necessary software to use thousands of 'vans' to enhance the performance of your code.
CUDA Installation On Mac OSX
In this guide, I explain how to install CUDA 6.0 (the latest release as I write) on your computer under OS X.
Finder menu 'GO'
General System Requirements
There are some general requirements which are common regardless of the operating system you use. The most important one is a CUDA-capable GPU, so you need a recent NVIDIA graphics card. A full list is available here. The other requirement is to have the CUDA Toolkit, which is free and provides you all you need to install and run CUDA code. By clicking on this link you will open the download page. Choose your operating system (in this case I presume Mac OS X) and then download the package by clicking on PKG.
CUDA 6.0 Downloads page
If you don't know the card/cards available on your Mac, then just go to Application > Utilities > System Information or search for System Information with Spotlight in this way and click on the icon.
Searching with Spotlight
Then look for Graphics/Displays and you will get information on your graphics card, including the name. In this case I have two of them and, fortunately, one of them is an NVIDIA.
System Information - Graphics/Displays
Mac OS X Requirements
If you want to install CUDA 6.0 on a Mac you need to have OS X 10.8 (Lion) or later running on your computer. If you don't, you can download Mavericks (OS X 10.9) from the App Store, which is free. In the situation where you cannot install OS X 10.8 or later, don't worry: you can install older CUDA releases. The installation is similar, but if some of you experience trouble, I will provide help in future articles.
In order to use CUDA 6.0 you need the GNU Compiler Collection (gcc) and clang on your Mac. They are compliers for the C-family of programming languages and CUDA is a library for them. Actually, you will code the 'serial' (non-parallel) parts of your code in C or C++. To get these two compilers you first need the Command Line Tools, which once again are free to download from the App Store.
Anyway, as you might have already installed the Command Line Tools without even noticing (especially if you already have XCode), I suggest you check its presence by going to the folder /Library/Developer/ by clicking on Go to Folder in the Finder menu or by using the shortcut Shift - Apple Key - G after clicking the Finder icon.
Go to Folder Window
If you find the folder named CommandLineTools you can then check for needed packages by entering it, opening the usr folder and then bin. If you already have the CommandLineTools folder you should very likely even have the clang and gcc packages. If you don't then you will need to download them.
Open your Terminal (which can be found in /Applications/Utilities or, as usual, by typing 'Terminal' in Spotlight and then clicking on its icon) and typing into the terminal:
Terminal on OS X
Then a window will appear, asking you if you want to download and install this package. Click yes, and the installation will proceed. Do not close the Terminal as we will need it later.
CommandLineTools installation window
Installing CUDA Packages
In the previously downloaded CUDA package, you should find three distinct packages: CUDA Driver, CUDA Toolkit and CUDA Samples. Despite the fact that the only essential one is the CUDA Driver, I suggest you install all of them, as they are very useful.
Packages selection during CUDA 6.0 installation
As always installation of Mac OS X packages is straightforward. Just click 'Continue' on every window. At one point you will have to agree to terms and conditions by clicking on the Agree button when it appears) and then Install in the final one. Now you have CUDA 6.0 installed on your Mac, but it is not quite ready to be used. You have to carry out the final two steps. Open the Terminal (if you missed how to do this, just read a couple of paragraphs above) and then type or, more conveniently, copy and paste, the following:
Setting path variables on Terminal
This will set the environment path variables, which is necessary to use CUDA. If you have a Mac with a CUDA-capable graphic card, you probably actually have two graphic cards: an integrated one and a separate, discrete one. Since it is consumes a lot of batter power to always have the discrete card in use, OS X could prevent it by automatically switching between the two cards. So, when you want to use CUDA you have to be sure that your Mac won't 'decide' to use the integrated card while you run a script.
System Preferences panel
Now go to System Preferences > Energy Saver (you can find System Preferences in the Utilities folder or using Spotlight), drag the Computer sleep bar to Never and uncheck Automatic Graphic Switching.
Energy Saver panel
Since it will get boring to follow this procedure every time you want to use CUDA, you can download gfxCardStatus (which is free and open-source) and switch between graphics cards in a couple of clicks directly from your menu bar, as you can see in the following picture. Actually, this was my choice and I'm pretty satisfied with how it works. Also, it could be useful to have direct control of graphics switching regardless of CUDA.
Avg secure vpn for mac. Nonetheless, for users that only occasionally use VPNs to perform privacy-sensitive tasks, such as online transactions, TunnelBear is the best VPN service to have free of cost for Mac.For more information, see this.
gfxCardStatus menu
Verification
Now that we have finished the installation procedure, CUDA should work. To be sure, it is worth following this verification procedure.
To see if the CUDA Driver is installed correctly, type the following into your terminal:
You should get a response like this:
Checking for the CUDA Driver
If you get an error, reboot your Mac and try again. If this verification is once again unsuccessful, reinstall all the CUDA packages you downloaded from NVIDIA's website.
Now you have to check the installation of the nvcc compiler. As you should have installed CUDA in the suggested directory, using the Terminal you can check nvcc availability by typing:
If you didn't install it here, just replace the above line with the directory you used.
If you get something like this:
Checking for NVCC
or anything that doesn't include 'not found' you are ok. Otherwise, look for nvcc in the bin folder.
NVCC in bin folder
Now it's time to run some samples provided by NVIDIA. Here I make use of the samples suggested by NVIDIA, as two of them are useful to check if your GPU is ready to work with what you have just installed.
In your terminal go to the samples folder. Again, if you have installed CUDA in the suggested directory, just type this line in your terminal:
and then copy and paste the following lines (you could write and run one sample at time, but this is a quicker way):
If you get no errors, we've almost made it. Please note that you may experience some warnings (I had). This is not really a thing to worry about as CUDA will work anyway, but if you have some troubles don't hesitate to write a comment and I will answer you as soon as possible.
If you need the work done quickly and have to move a lot of furniture, of course you will chose the second company. Each of the men is much slower than the strong guy, but if they are able to transport your load concurrently they will have the time to complete the task, have a beer together and come back to their family before the strong guy has done half the work. GPU computing is like having hundreds and thousands of skinny guys with old vans, which can be pretty effective.
This is the main idea about parallel computing. What follows are the instructions to install the necessary software to use thousands of 'vans' to enhance the performance of your code.
CUDA Installation On Mac OSX
In this guide, I explain how to install CUDA 6.0 (the latest release as I write) on your computer under OS X.
Finder menu 'GO'
General System Requirements
There are some general requirements which are common regardless of the operating system you use. The most important one is a CUDA-capable GPU, so you need a recent NVIDIA graphics card. A full list is available here. The other requirement is to have the CUDA Toolkit, which is free and provides you all you need to install and run CUDA code. By clicking on this link you will open the download page. Choose your operating system (in this case I presume Mac OS X) and then download the package by clicking on PKG.
CUDA 6.0 Downloads page
If you don't know the card/cards available on your Mac, then just go to Application > Utilities > System Information or search for System Information with Spotlight in this way and click on the icon.
Searching with Spotlight
Then look for Graphics/Displays and you will get information on your graphics card, including the name. In this case I have two of them and, fortunately, one of them is an NVIDIA.
System Information - Graphics/Displays
Mac OS X Requirements
If you want to install CUDA 6.0 on a Mac you need to have OS X 10.8 (Lion) or later running on your computer. If you don't, you can download Mavericks (OS X 10.9) from the App Store, which is free. In the situation where you cannot install OS X 10.8 or later, don't worry: you can install older CUDA releases. The installation is similar, but if some of you experience trouble, I will provide help in future articles.
In order to use CUDA 6.0 you need the GNU Compiler Collection (gcc) and clang on your Mac. They are compliers for the C-family of programming languages and CUDA is a library for them. Actually, you will code the 'serial' (non-parallel) parts of your code in C or C++. To get these two compilers you first need the Command Line Tools, which once again are free to download from the App Store.
Anyway, as you might have already installed the Command Line Tools without even noticing (especially if you already have XCode), I suggest you check its presence by going to the folder /Library/Developer/ by clicking on Go to Folder in the Finder menu or by using the shortcut Shift - Apple Key - G after clicking the Finder icon.
Go to Folder Window
If you find the folder named CommandLineTools you can then check for needed packages by entering it, opening the usr folder and then bin. If you already have the CommandLineTools folder you should very likely even have the clang and gcc packages. If you don't then you will need to download them.
Open your Terminal (which can be found in /Applications/Utilities or, as usual, by typing 'Terminal' in Spotlight and then clicking on its icon) and typing into the terminal:
Terminal on OS X
Then a window will appear, asking you if you want to download and install this package. Click yes, and the installation will proceed. Do not close the Terminal as we will need it later.
CommandLineTools installation window
Installing CUDA Packages
In the previously downloaded CUDA package, you should find three distinct packages: CUDA Driver, CUDA Toolkit and CUDA Samples. Despite the fact that the only essential one is the CUDA Driver, I suggest you install all of them, as they are very useful.
Packages selection during CUDA 6.0 installation
As always installation of Mac OS X packages is straightforward. Just click 'Continue' on every window. At one point you will have to agree to terms and conditions by clicking on the Agree button when it appears) and then Install in the final one. Now you have CUDA 6.0 installed on your Mac, but it is not quite ready to be used. You have to carry out the final two steps. Open the Terminal (if you missed how to do this, just read a couple of paragraphs above) and then type or, more conveniently, copy and paste, the following:
Setting path variables on Terminal
This will set the environment path variables, which is necessary to use CUDA. If you have a Mac with a CUDA-capable graphic card, you probably actually have two graphic cards: an integrated one and a separate, discrete one. Since it is consumes a lot of batter power to always have the discrete card in use, OS X could prevent it by automatically switching between the two cards. So, when you want to use CUDA you have to be sure that your Mac won't 'decide' to use the integrated card while you run a script.
System Preferences panel
Now go to System Preferences > Energy Saver (you can find System Preferences in the Utilities folder or using Spotlight), drag the Computer sleep bar to Never and uncheck Automatic Graphic Switching.
Energy Saver panel
Since it will get boring to follow this procedure every time you want to use CUDA, you can download gfxCardStatus (which is free and open-source) and switch between graphics cards in a couple of clicks directly from your menu bar, as you can see in the following picture. Actually, this was my choice and I'm pretty satisfied with how it works. Also, it could be useful to have direct control of graphics switching regardless of CUDA.
Avg secure vpn for mac. Nonetheless, for users that only occasionally use VPNs to perform privacy-sensitive tasks, such as online transactions, TunnelBear is the best VPN service to have free of cost for Mac.For more information, see this.
gfxCardStatus menu
Verification
Now that we have finished the installation procedure, CUDA should work. To be sure, it is worth following this verification procedure.
To see if the CUDA Driver is installed correctly, type the following into your terminal:
You should get a response like this:
Checking for the CUDA Driver
If you get an error, reboot your Mac and try again. If this verification is once again unsuccessful, reinstall all the CUDA packages you downloaded from NVIDIA's website.
Now you have to check the installation of the nvcc compiler. As you should have installed CUDA in the suggested directory, using the Terminal you can check nvcc availability by typing:
If you didn't install it here, just replace the above line with the directory you used.
If you get something like this:
Checking for NVCC
or anything that doesn't include 'not found' you are ok. Otherwise, look for nvcc in the bin folder.
NVCC in bin folder
Now it's time to run some samples provided by NVIDIA. Here I make use of the samples suggested by NVIDIA, as two of them are useful to check if your GPU is ready to work with what you have just installed.
In your terminal go to the samples folder. Again, if you have installed CUDA in the suggested directory, just type this line in your terminal:
and then copy and paste the following lines (you could write and run one sample at time, but this is a quicker way):
If you get no errors, we've almost made it. Please note that you may experience some warnings (I had). This is not really a thing to worry about as CUDA will work anyway, but if you have some troubles don't hesitate to write a comment and I will answer you as soon as possible.
Let's now see the results of those tests (the last two scripts). The previous make commands created a new folder, which is where we want to go now. This new folder can be reached by adding bin/x86_64/darwin/release to the path of the 'samples' folder, so you can type:
in your Terminal and then run both the script deviceQuery and bandwidthTest by writing:
I suggest you run those scripts one at a time, but of course you can just copy and paste both these lines and press enter.
Note that the returned parameters will change depending on your hardware and software, so don't worry if you don't have the same lines as the following screens:
deviceQuery report - check the circled part
bandwidthTest report
If you can see what I highlighted in the above figures with circles, then congratulations! You can now use CUDA on your Mac!
In next set of articles I will write about programming in CUDA and, more generally, parallel computing, to provide you with a comprehensive tutorial on how to code your own CUDA scripts with useful financial examples.
In the meantime, I suggest you get more confident with this environment by having a look at NVIDIA's samples and the NVIDIA Nsight Eclipse edition IDE (where you actually write code), which can be found in /Developer/NVIDIA/CUDA-6.0/libnsight.
Nvidia Cuda Drivers For Mac
Quadro & GeForce macOS Driver Release 367.15.10.35 | |
Data de Lançamento: | 2017.1.25 |
Sistema Operacional: | |
Linguagem: | Português (Brazil) |
Tamanho: | 58.96 MB |
Produtos suportados |
CUDA Application Support: In order to run Mac OS X Applications that leverage the CUDA architecture of certain NVIDIA graphics cards, users will need to download and install the driver for Mac located here. New in Release 367.15.10.35f01:
Release Notes Archive: This driver update is for Mac Pro 5,1 (2010), Mac Pro 4,1 (2009) and Mac Pro 3,1 (2008) users. BETA support is for iMac 14,2 / 14,3 (2013), iMac 13,1 / 13,2 (2012) and MacBook Pro 11,3 (2013), MacBook Pro 10,1 (2012), and MacBook Pro 9,1 (2012) users. MINIMUM SYSTEM REQUIREMENTS for Driver Release 367.15.10.35f01
To download and install the drivers, follow the steps below: STEP 1: Make sure your Mac OS X software version is v10.12.3 (16D32). It is important that you check this first before you install the 367.15.10.35f01 Driver. Click on the Apple icon (upper left corner of the screen) and select About This Mac. Click the More Info button to see the exact build version number (16D32) in the Software field. STEP 2: If your OS X software version has not been updated, in the About This Mac window, click on the Software Update button STEP 3: Continue to install software updates until your system OS is reported to be v10.12.3 (16D32) STEP 4: Review the NVIDIA Software License. Check terms and conditions checkbox to allow driver download. You will need to accept this license prior to downloading any files. STEP 5: Download the Driver File Download - WebDriver-367.15.10.35f01.pkg STEP 6: Install After downloading the driver package, it should automatically launch the installer. If it does not, double-click on the driver package from your download target location. It will guide you through the installation process. Click Continue after you read the License Agreement and then click Agree STEP 7: Click Install on the Standard Installer screen. You will be required to enter an Administrator password to continue STEP 8: Click Continue Installation on the Warning screen: The Warning screen lets you know that you will need to restart your system once the installation process is complete. STEP 9: Click Restart on the Installation Completed Successfully screen. This driver includes the new NVIDIA Driver Manager preference pane, as well as an optional menu bar item for quick access to the preference pane and basic functions. The preference pane can be accessed normally through the System Preferences. It requires the user to click on the padlock icon and enter an Administrator password to make changes, and contains the following functionality: GRAPHICS DRIVER TAB: Within this tab, the user can switch between the NVIDIA Web Driver and the default NVIDIA graphics driver that is included with OS X v10.12.3 (16D32). If the user switches between drivers, they must click the Restart button for changes to take effect. ECC TAB: Within this tab, the user can enable or disable ECC functionality on supported graphics cards. The user will see a list of their system's PCI-E slots and any devices installed in them. If a device supports ECC, the user will be able to check the Enable Error Correcting Codes box next to the list. If the device does not support ECC then the box will be grayed out. Once the user makes changes to ECC, they will be required to restart the system. NOTE: Currently, the only NVIDIA graphics card that supports ECC functionality is the NVIDIA Quadro K5000 for Mac. Enabling ECC requires a portion of the graphics card's usable memory size and bandwidth. In the Graphics/Displays section of your System Information, you may notice the 'VRAM (Total)' amount of your NVIDIA Quadro K5000 drops from 4096 MB to 3584 MB when ECC is enabled. This is normal. UPDATES TAB: This tab shows the version number of the NVIDIA Web Driver that is currently installed on the system and also allows the user to check for updates online. By clicking the Check Now button, the NVIDIA Driver Manager will ping NVIDIA's master server to see if there is a newer version of the NVIDIA Web Driver available. There are also checkboxes for the user to allow the NVIDIA Driver Manager to check automatically for updates and to download them when available. If a new NVIDIA Web Driver is downloaded automatically, the user will be notified when it's ready to be installed. Automatic checking is on by default. MENU BAR ITEM AND UNINSTALLER: The NVIDIA Driver Manager also includes a checkbox to toggle a menu bar item on and off, and a button to open an Uninstaller app. The menu bar item includes the functionality of the Graphics Driver tab and a shortcut to launch the NVIDIA Driver Manager. To uninstall the NVIDIA Web Driver and the NVIDIA Driver Manager, follow the steps below: STEP 1: Open the NVIDIA Driver Manager from the System Preferences or through the menu bar item. STEP 2: Click on the padlock icon and enter an Administrator password. STEP 3: Click the Open Uninstaller button. STEP 4: Click Uninstall and then Continue Uninstallation on the Warning screen: The Warning screen lets you know that you will need to restart your system once the installation process is complete. STEP 5: Re-enter an Administrator password and click OK. Once the NVIDIA Web Driver and NVIDIA Driver Manager have been removed from the system, click Restart. NOTE: If for any reason you are unable to boot your system to the Desktop and wish to restore your original OS X v10.12.3 (16D32) driver, you can do so by clearing your Mac's NVRAM: STEP 1: Restart your Macintosh computer and simultaneously hold down the 'Command' (apple) key, the 'Option' key, the 'P' key and the 'R' key before the gray screen appears. STEP 2: Keep the keys held down until you hear the startup chime for the second time. Release the keys and allow the system to boot to the desktop. STEP 3: The original OS X v10.12.3 (16D32) driver will be restored upon booting, although the NVIDIA Web Driver and NVIDIA Driver Manager will not be uninstalled from the system. GeForce 600 Series: GeForce GTX 680 GeForce GTX 285 GeForce GT 120 GeForce 8800 GT Quadro K5000 for Mac, Quadro 4000 for Mac Quadro FX 4800, Quadro FX 5600 |