returnn.util.cuda_env

CUDA environment detection and information.

class returnn.util.cuda_env.CudaEnv[source]

Information about the Nvidia CUDA environment, and library. Also path to nvcc, the CUDA compiler.

verbose_find_cuda = False[source]
is_available()[source]
Return type:

bool

get_cuda_version() Tuple[int, int][source]

Get CUDA version as (major, minor).

get_max_compute_capability()[source]
Returns:

the highest compute capability supported by nvcc, or float(“inf”) if not known

Return type:

float

static get_cc_bin() str[source]
Returns:

path

get_compiler_opts()[source]
Return type:

list[str]

get_lib_dir_path() str[source]

library path

get_compiler_bin()[source]
Returns:

path

Return type:

str

classmethod get_instance() CudaEnv[source]
Returns:

instance for this class

returnn.util.cuda_env.get_cuda_path_candidates_from_common_install_locations() List[str][source]
Returns:

list of possible CUDA installation paths from common locations

returnn.util.cuda_env.get_best_nvcc_path_for_cuda_version(cuda_version: Tuple[int, int]) str[source]
Returns:

path to nvcc

Return type:

str