Utilizing gpu for Matlab ONLY

3 views (last 30 days)
Albert
Albert on 1 Aug 2012
Answered: Luca on 24 May 2014
I'm running a Macbook Pro, which has two graphics cards, a lower power, integrated card, and a higher power, discrete card. The MBP turns the cards on and off alternatively to optimize performance/power consumption. What I would like to do is use the cards simultaneously- the integrated card to run the graphics, and the discrete card to do computations. Unfortunately, I can't seem to figure out how to get the discrete card turned on, without the system then using it to run the graphics. The result is less memory/fragmented memory available to matlab, and therefore rather limited performance.
gfxCardStatus lets me select the card I'd like the system to use for the graphics- so I can select the integrated card to run the graphics. But this turns off the discrete card entirely. Perhaps there is a way to turn the discrete card back on? Or any other ideas?
Thanks, ASmith

Accepted Answer

Jason Ross
Jason Ross on 1 Aug 2012
I think I found your answer in the second bullet of the release notes of the CUDA driver for this GPU. I left the first bullet in because it also looks quite important.:
Known Issues
• There is a known issue in this release where forcing or allowing the system to go to sleep while running CUDA applications on 2012 MacBook Pro models with automatic graphics switching will cause a system crash (kernel panic). You can prevent the computer from automatically going to sleep by setting the Computer Sleep option slider to Never in the Energy Saver pane of the System Preferences.
• There is a known issue in this release where CUDA applications will not automatically engage the discrete GPU on 2012 MacBook Pro models with automatic graphics switching. To run CUDA applications, it is necessary to uncheck the Automatic Graphics Switching checkbox in the Energy Saver pane of the System Preferences.
Quadro FX for Mac or GeForce for Mac must be installed prior to CUDA 5.0.17 installation
  2 Comments
Albert
Albert on 1 Aug 2012
Thanks Jason- these are along the lines of what I'm trying to do, but don't quite solve the problem. Actually, I think the latest OSX update may have solved the kernel panic problem, but I'd have to give it a few more days to be sure. I had a lot of crashes initially, but it's been ok the past couple days.
So, the energy saver preference ensures that the discrete gpu is turned on. However, once it is on, the Macbook Pro is using it to run the graphics. For example, right now MatLab tells me that I have 1.0734e+09 bytes Total Memory on the graphics card, but I only have 567119872 bytes free. So, I've lost just under half my memory to running the graphics. Whereas, if I could get the graphics to run off the integrated card, then I would have the full power of the discrete card for computation. So, that's what I'm trying to achieve.
Jason Ross
Jason Ross on 1 Aug 2012
I don't have a machine like this immediately at hand, but if I did, I'd see if nVidia has provided either the nvidia-settings or nvidia-smi utility with the installation. You'd likely need to run them from Terminal.
There's also a CUDA settings application in the System Settings, but I don't think it does too much other than allow you to check for driver updates, but something could be different with the new driver.

Sign in to comment.

More Answers (1)

Luca
Luca on 24 May 2014
I am really interested in an answer to this question as well!
Did you find a way?

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!