Distributing CUDA enabled applications on Mac OS X
How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?

From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.

Anyone have any ideas?
How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?



From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.



Anyone have any ideas?

#1
Posted 06/13/2011 11:06 PM   
How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?

From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.

Anyone have any ideas?
How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?



From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.



Anyone have any ideas?

#2
Posted 06/13/2011 11:06 PM   
Port your CUDA program to OpenCL, which is natively supported on OS X. And since you already use the driver API, that should not be too difficult.
Port your CUDA program to OpenCL, which is natively supported on OS X. And since you already use the driver API, that should not be too difficult.

Always check return codes of CUDA calls for errors. Do not use __syncthreads() in conditional code unless the condition is guaranteed to evaluate identically for all threads of each block. Run your program under cuda-memcheck to detect stray memory accesses. If your kernel dies for larger problem sizes, it might exceed the runtime limit and trigger the watchdog timer.

#3
Posted 06/14/2011 10:41 AM   
Port your CUDA program to OpenCL, which is natively supported on OS X. And since you already use the driver API, that should not be too difficult.
Port your CUDA program to OpenCL, which is natively supported on OS X. And since you already use the driver API, that should not be too difficult.

Always check return codes of CUDA calls for errors. Do not use __syncthreads() in conditional code unless the condition is guaranteed to evaluate identically for all threads of each block. Run your program under cuda-memcheck to detect stray memory accesses. If your kernel dies for larger problem sizes, it might exceed the runtime limit and trigger the watchdog timer.

#4
Posted 06/14/2011 10:41 AM   
OpenCL on Mac OS X (and other platforms too) is lagging far behind CUDA on many features, as well on performances.
It is clearly not a olution at this time, compared to CUDA-optimized code.
OpenCL on Mac OS X (and other platforms too) is lagging far behind CUDA on many features, as well on performances.

It is clearly not a olution at this time, compared to CUDA-optimized code.

Parallelis.com, Parallel-computing technologies and benchmarks. Current Projects: OpenCL Chess & OpenCL Benchmark

#5
Posted 07/05/2011 03:31 AM   
[quote name='mach4' date='14 June 2011 - 12:06 AM' timestamp='1308006389' post='1251364']
How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?

From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.

Anyone have any ideas?
[/quote]
I've been looking into this a bit. I tried to include the CUDA runtime libs in the application bundle, but that didn't work. The error was weird, it claimed that I had the wrong version of the runtime - with the same libraries that works on my development installation! It seems CUDA makes some kind of check for its files, thereby requiring (part of?) a developer installation.

What parts of the CUDA installation are used when running a CUDA program? Runtime libraries of course. More? Driver, I suppose, but I don't know how drivers are installed in OSX. Anyone who knows?
[quote name='mach4' date='14 June 2011 - 12:06 AM' timestamp='1308006389' post='1251364']

How can I distribute my driver-API CUDA program so that the end user can directly run it on a clean install of OS X?



From testing, it seems like the user has to install the developer drivers first. This is far from ideal in my opinion, and I would prefer if there was a way to bundle everything in my application. Specially since downloading the developer drivers is more convoluted than it should be, there isn't even a permanent URL I could direct the user to that would still be valid after CUDA version changes.



Anyone have any ideas?



I've been looking into this a bit. I tried to include the CUDA runtime libs in the application bundle, but that didn't work. The error was weird, it claimed that I had the wrong version of the runtime - with the same libraries that works on my development installation! It seems CUDA makes some kind of check for its files, thereby requiring (part of?) a developer installation.



What parts of the CUDA installation are used when running a CUDA program? Runtime libraries of course. More? Driver, I suppose, but I don't know how drivers are installed in OSX. Anyone who knows?

#6
Posted 11/22/2011 09:34 PM   
[quote name='Ragnemalm' date='22 November 2011 - 02:34 PM' timestamp='1321997659' post='1331180']
I've been looking into this a bit. I tried to include the CUDA runtime libs in the application bundle, but that didn't work. The error was weird, it claimed that I had the wrong version of the runtime - with the same libraries that works on my development installation! It seems CUDA makes some kind of check for its files, thereby requiring (part of?) a developer installation.

What parts of the CUDA installation are used when running a CUDA program? Runtime libraries of course. More? Driver, I suppose, but I don't know how drivers are installed in OSX. Anyone who knows?
[/quote]

If you use the Runtime API (driver API-only apps can skip this), you should always distribute the CUDA Runtime with your application, ideally by internalizing the the runtime dylib as a private dylib inside your application bundle's Frameworks directory.
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

Any other CUDA toolkit libraries your app uses should be similarly internalized. Make sure that the runtime version is as new or newer than the libraries, or you will get an API version mismatch problem.

To use CUDA, the user will need to download and install the latest CUDA driver version. This page seems like a reasonable place to find the latest driver download.
http://www.nvidia.com/object/mac-driver-archive.html
[quote name='Ragnemalm' date='22 November 2011 - 02:34 PM' timestamp='1321997659' post='1331180']

I've been looking into this a bit. I tried to include the CUDA runtime libs in the application bundle, but that didn't work. The error was weird, it claimed that I had the wrong version of the runtime - with the same libraries that works on my development installation! It seems CUDA makes some kind of check for its files, thereby requiring (part of?) a developer installation.



What parts of the CUDA installation are used when running a CUDA program? Runtime libraries of course. More? Driver, I suppose, but I don't know how drivers are installed in OSX. Anyone who knows?





If you use the Runtime API (driver API-only apps can skip this), you should always distribute the CUDA Runtime with your application, ideally by internalizing the the runtime dylib as a private dylib inside your application bundle's Frameworks directory.

http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19



Any other CUDA toolkit libraries your app uses should be similarly internalized. Make sure that the runtime version is as new or newer than the libraries, or you will get an API version mismatch problem.



To use CUDA, the user will need to download and install the latest CUDA driver version. This page seems like a reasonable place to find the latest driver download.

http://www.nvidia.com/object/mac-driver-archive.html

#7
Posted 01/11/2012 02:48 AM   
Scroll To Top