NVIDIA GPUs Get SYCL Support After Codeplay Contributes To Development Of DPC++ Standard

After gaining support from leading companies like Intel, Xilinx, Renesas and Imagination Technologies, the SYCL (pronounced ‘sickle’), the developers using NVIDIA GPUs will now be able to gain the benefit as well. Codeplay, the organization that has steadfastly been an active contributor to the SYCL Community, has now culminated the advanced development of DPC++ (Data Parallel C++), which facilities recycling and reusing code across several hardware platforms. The result is ComputeCpp, Codeplay’s own implementation of SYCL.

ComputeCpp’s Latest Edition Offers Experimental Support For NVIDIA GPUs using OpenCL and NVIDIA’s PTX

Last year, Intel took a decisive step to give a push to SYCL, and even began working on oneAPI Standard. The oneAPI includes DPC++ (an implementation of SYCL with extensions) for Intel’s CPUs, GPUs and FPGAs. The movement soon became quite big and gained momentum after support for SYCL came in from Xilinx, Renesas, and Imagination Technologies. Simply put, software developers are now able to target a wide range of devices using SYCL.

The ComputeCpp offers experimental support for NVIDIA GPUs using OpenCL and NVIDIA’s PTX. But DPC++ (Intel’s SYCL implementation) offers the opportunity to add full support for NVIDIA GPUs integrated into the LLVM compiler without going through OpenCL. Codeplay announced that they are open-sourcing the initial, experimental phase of their implementation that enables SYCL developers to target NVIDIA GPUs. The codebase for this implementation stays in a separate fork from both the main LLVM compiler project and the DPC++ branch. The organization added that they intend to work with Intel to get the NVIDIA GPU support added to the upstream Intel/LLVM compiler.

How Can Developers Benefit From The SYCL Support For NVIDIA GPUs?

This project enables developers to target NVIDIA GPUs using SYCL code, without having to go through the OpenCL layer in the system. In other words, with just an NVIDIA GPU, developers can run DPC++ on their system to compile SYCL applications. Moreover, any existing CUDA Application can be incrementally ported to SYCL using the CUDA support, and then run it on a platform that doesn’t have CUDA. This clearly saves a lot of time and repeated efforts.

Codeplay has offered instructions on the project README file explaining how to use the NVIDIA back-end for DPC++. Developers are required to use some flags when compiling, and some code to set up their device selector to ensure the runtime knows what device to target.  In particular, the section “Build SYCL toolchain with support for NVIDIA CUDA” and the Clang compiler options have specific instructions.

Codeplay confirmed they successfully ran the project with Ubuntu 18.04 using CUDA 10.1 on a Titan RTX GPU (compute capabilities 7.5). The team assures that it should also work on other Linux versions with any NVIDIA GPU compatible with SM 5.0 or above. However, the compiled SYCL application will only be able to either target CUDA or OpenCL, not both at the same time.

The team also cautions that the initial release of the project has not been optimized, so performance may not be optimal in all circumstances. In other words, developers will need to deploy the same and ascertain the speed improvements themselves, if there are any. This is because the code generation doesn’t apply any particular optimization passes. Moreover, the CUDA implementation of the SYCL specification in the Plugin Interface doesn’t use any advanced CUDA features.

Codeplay has indicated that boosting compatibility and functionality remain their top priorities. They indicated that the current focus is to implement as much functionality as possible so that developers can run a range of SYCL applications on NVIDIA GPU platforms. Performance optimizations will come later on with the help of community members.