Package 'pjrt.cuda'

Title: CUDA Toolkit Libraries for 'pjrt'
Description: Provides the CUDA 13.3 native libraries required by the CUDA PJRT plugin used by the 'pjrt' package (CUDA runtime, cuBLAS, cuDNN, CUPTI, NVRTC, cuFFT, cuSOLVER, cuSPARSE, NvJitLink, NCCL, and NVCC). The package itself is lightweight; the CUDA components are downloaded as NVIDIA's official redistributable binaries from PyPI into a user cache directory the first time the package is loaded.
Authors: Sebastian Fischer [cre, aut] (ORCID: <https://orcid.org/0000-0002-9609-3197>), Daniel Falbel [aut] (ORCID: <https://orcid.org/0009-0006-0143-2392>)
Maintainer: Sebastian Fischer <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2026-10-10 15:14:30 UTC
Source: https://github.com/r-xla/pjrt.cuda

Help Index


pjrt.cuda: CUDA Toolkit Libraries for 'pjrt'

Description

Provides the CUDA 13.3 native libraries required by the CUDA PJRT plugin used by the 'pjrt' package (CUDA runtime, cuBLAS, cuDNN, CUPTI, NVRTC, cuFFT, cuSOLVER, cuSPARSE, NvJitLink, NCCL, and NVCC). The package itself is lightweight; the CUDA components are downloaded as NVIDIA's official redistributable binaries from PyPI into a user cache directory the first time the package is loaded.

Installation of the CUDA components

The package itself is lightweight. The CUDA components (several GB) are downloaded from PyPI into cuda_home() the first time the package is loaded, or when install_cuda() is called. Whether loading the package may download them is controlled by the environment variable PJRT_INSTALL, which is shared with the pjrt package:

  • PJRT_INSTALL=1: download without asking (e.g. CI, scripts, Docker builds).

  • PJRT_INSTALL=0: never download.

  • unset: ask for confirmation in an interactive session, do nothing in a non-interactive one.

Environment Variables

  • PJRT_INSTALL: Whether loading the package may download the CUDA components, see above.

  • PJRT_CUDA_HOME: Directory in which the CUDA components are installed. Defaults to tools::R_user_dir("pjrt.cuda", "cache").

  • PJRT_CUDA_COMPONENTS: Comma-separated list of components to install (default: all components), e.g. "runtime,cublas,cudnn". A component's pinned version can be overridden with @, e.g. "[email protected]". Note that the pjrt CUDA backend requires all components to be present.

Third-Party Licenses

The pjrt.cuda package itself is MIT-licensed. It does not bundle NVIDIA software; instead it downloads NVIDIA's official redistributable binaries from PyPI. Their use is governed by the NVIDIA CUDA Toolkit EULA, with the exception of cuDNN, which is covered by the NVIDIA cuDNN SLA, and NCCL, which is covered by its own license. By downloading them you accept those terms.

Author(s)

Maintainer: Sebastian Fischer [email protected] (ORCID)

Authors:

See Also

Useful links:


Path to a CUDA Component's Binaries

Description

Returns the bin directory of a single CUDA component (e.g. ptxas for "nvcc").

Usage

bin_path(component)

Arguments

component

(character(1))
Component name (e.g., "runtime", "cublas", "nvcc"). See inst/components.tsv for the full list.

Value

(character(1))
Path to the component's bin directory.


Installation Directory of the CUDA Components

Description

Returns the directory into which the CUDA components are downloaded. This is tools::R_user_dir("pjrt.cuda", "cache") unless the environment variable PJRT_CUDA_HOME is set.

Usage

cuda_home()

Value

(character(1))
Path to the installation directory (which may not exist yet).


Are the CUDA Components Installed?

Description

Checks whether the CUDA components selected by PJRT_CUDA_COMPONENTS (default: all) are installed in cuda_home() with the versions pinned by this version of the package.

Usage

cuda_installed()

Value

(logical(1))


Path to a CUDA Component Installation

Description

Returns the installation root of a single CUDA component.

Usage

cuda_path(component)

Arguments

component

(character(1))
Component name (e.g., "runtime", "cublas", "nvcc"). See inst/components.tsv for the full list.

Value

(character(1))
Path to the installed component files.


Path to a CUDA Component's Headers

Description

Returns the include directory of a single CUDA component.

Usage

include_path(component)

Arguments

component

(character(1))
Component name (e.g., "runtime", "cublas", "nvcc"). See inst/components.tsv for the full list.

Value

(character(1))
Path to the component's include directory.


Install the CUDA Components

Description

Downloads the CUDA components from PyPI and unpacks them into cuda_home(). This runs automatically when the package is loaded (see pjrt.cuda-package for how to control that), so calling it manually is only needed to force a reinstallation or to install in a session where automatic downloads are disabled.

Which components are installed is controlled by the environment variable PJRT_CUDA_COMPONENTS, see pjrt.cuda-package.

Usage

install_cuda(reinstall = FALSE)

Arguments

reinstall

(logical(1))
Whether to reinstall even if the components are already installed.

Value

(character(1))
The installation directory, invisibly.


Path to the Shared Library Directory

Description

All CUDA component shared libraries are installed into a single directory, which this function returns.

Usage

lib_path()

Value

(character(1))
Path to the lib directory.