Is it possible to run CUDA on AMD GPUs?

211,407

Solution 1

Nope, you can't use CUDA for that. CUDA is limited to NVIDIA hardware. OpenCL would be the best alternative.

Khronos itself has a list of resources. As does the StreamComputing.eu website. For your AMD specific resources, you might want to have a look at AMD's APP SDK page.

Note that at this time there are several initiatives to translate/cross-compile CUDA to different languages and APIs. One such an example is HIP. Note however that this still does not mean that CUDA runs on AMD GPUs.

Solution 2

You can run NVIDIA® CUDA™ code on Mac, and indeed on OpenCL 1.2 GPUs in general, using Coriander . Disclosure: I'm the author. Example usage:

cocl cuda_sample.cu
./cuda_sample

Result: enter image description here

Solution 3

Yup. :) You can use Hipify to convert CUDA code very easily to HIP code which can be compiled run on both AMD and nVidia hardware pretty good. Here are some links

GPUOpen very cool site by AMD that has tons of tools and software libraries to help with different aspects of GPU computing many of which work on both platforms

HIP Github Repository that shows the process to hipify

HIP GPUOpen Blog

Update 2021: AMD changed the Website Link go to ROCm website

https://rocmdocs.amd.com/en/latest/

Solution 4

You can't use CUDA for GPU Programming as CUDA is supported by NVIDIA devices only. If you want to learn GPU Computing I would suggest you to start CUDA and OpenCL simultaneously. That would be very much beneficial for you.. Talking about CUDA, you can use mCUDA. It doesn't require NVIDIA's GPU..

Solution 5

I think it is going to be possible soon in AMD FirePro GPU's, see press release here but support is coming 2016 Q1 for the developing tools:

An early access program for the "Boltzmann Initiative" tools is planned for Q1 2016.

Share:
211,407
Lee Jacobs
Author by

Lee Jacobs

I have a BS in Pure Math from UCSD with a minor in Computer Science. I am currently interested in computer graphics, probability theory, web development and game development.

Updated on July 08, 2022

Comments

  • Lee Jacobs
    Lee Jacobs almost 2 years

    I'd like to extend my skill set into GPU computing. I am familiar with raytracing and realtime graphics(OpenGL), but the next generation of graphics and high performance computing seems to be in GPU computing or something like it.

    I currently use an AMD HD 7870 graphics card on my home computer. Could I write CUDA code for this? (my intuition is no, but since Nvidia released the compiler binaries I might be wrong).

    A second more general question is, Where do I start with GPU computing? I'm certain this is an often asked question, but the best I saw was from 08' and I figure the field has changed quite a bit since then.

  • Lee Jacobs
    Lee Jacobs over 11 years
    Like I figured. Any advice on where to get started on GPGPU programming with openCL?
  • Callum Rogers
    Callum Rogers over 11 years
    Check out the OpenCL Programming Guide. One of the awesome things about OpenCL vs CUDA is the much better tooling support
  • Yeasin Ar Rahman
    Yeasin Ar Rahman almost 7 years
    Although it was not possible before. It is now possible to run cuda code on AMD hardware. The concept is to convert it to HIP language. See my answer below to check the links.
  • Bart
    Bart almost 7 years
    That still doesn't mean you're running CUDA on an AMD device. It merely means you convert CUDA code into C++ code which uses the HIP API. It also doesn't support all features. I wouldn't classify this as a CUDA workflow for AMD devices.
  • Yeasin Ar Rahman
    Yeasin Ar Rahman over 6 years
    @Bart i think it was mentioned in the comment that you need to convert it to a intermediate language. And about features please mention which broad feature is not supported, i think most of them are. However some specific platform related tweaking is needed if you need extra performance. It is said in the doc that the performance is equal to any non-optimized/native CUDA code.
  • SamB
    SamB over 5 years
    Looks like that press release was talking about hcc (roughly speaking, AMD's analogue of nvcc) and HIP (which defines and implements a common API for use on both AMD and nVidia hardware, basically as a header-only library on top of CUDA and a whole runtime library for hcc). There's a relevant link farm in this other answer.
  • talonmies
    talonmies over 4 years
    If you read a bit more at the link you posted you will see that development of Ocelot stopped in 2012, and the AMD backend was never actually finished. This is in no way a viable option in 2019 (and it barely was in 2011)