CUDAnative on macOS X

Did anyone manage to get CUDAnative running on macOS X?

I could successfully install CUDAdrv …

push!(Libdl.DL_LOAD_PATH, "/usr/local/cuda/lib")
Pkg.add("CUDAdrv")

… but trying to add CUDAnative fails with LLVM errors: llvm-config not found.

Any idea?

Did you install CUDAnative according to the README or the recent blogpost? Because you need to compile Julia from source, or llvm-config and others will be missing.

That push to DL_LOAD_PATH shouldn’t be necessary, in sofar that directory is indexed by your library loader. Doesn’t macOS have something like ld.so.conf? CUDAdrv just uses Libdl.find_library.

(You might also want to post stuff about CUDAnative in Domains/GPU, which I’m watching for new posts.)

No, I did not compile Julia from source - I tried to use a local llvm installation (built from source), but that didn’t work.

libcuda isn’t found (in the default location). This is because on macOS X 10.12+ the DYLD_LIBRARY_PATH environment can not be set without disabling System Integrity Protection (rootless).

julia> Libdl.find_library("libcuda")
""

julia> push!(Libdl.DL_LOAD_PATH, "/usr/local/cuda/lib")
3-element Array{String,1}:
 "@loader_path/julia" 
 "@loader_path"       
 "/usr/local/cuda/lib"

julia> Libdl.find_library("libcuda")
"libcuda"

Right, not sure why you’re expecting it to work then. The LLVM library really needs to be not only identical (for code generation compatibility), but the very same one loaded by Julia (because of unresolved OSX issues).

1 Like

Seeing how /usr/local/cuda/lib seems like a popular, but non-indexed location of CUDA libraries, I’ve added it to the default search locations of CUDAdrv’s build script. So you won’t need to manually populate Libdl.DL_LOAD_PATH anymore (as soon as a new version is released).

Great! Thanks. :slight_smile:

You’re welcome. Let me know if you run into other issues: macOS is supposed to be a supported platform, but lacking hardware (both personal and for CI) it’s possible that issues have crept in.

I built Julia 0.6 from source and could successfully add CUDAnative on macOS X 10.12.4 Beta with CUDA 8.0. Examples are working …

Now, It’s up to Apple! Will they offer NVIDIA graphics cards for future iMacs or MacBooks?

1 Like

I learned to be very pessimistic about Apple and GPU support … And nobody will be able to tell you, since they don’t talk about what they plan to do! -.-

… I probably should have bought some MacBooks or iMacs with NVIDIA chipsets ahead :wink:

Well, if we would support OpenCL as well, it would be less of an issue! :slight_smile:
But Apple will still be annoying to deal with because of how they try to push Metal against all industry standards -.-

Cool, would be nice to see more of that! The web world is quite different anyways, though…
I’m just salty about how apple treats Vulkan :smiley:

Yes, I agree. Not to understand as Apple publishes the base sources for the macOS X run-time system (and supports a lot of OpenSource software) …