Skip to main content
Ctrl+K
Warning: This documentation is only a preview for PR 894!
cuda.bindings - Home cuda.bindings - Home

cuda.bindings

  • Release Notes
  • Installation
  • Overview
  • Motivation
  • Environment Variables
    • CUDA Python API Reference
    • Tips and Tricks
    • cuda.bindings Support Policy
    • Contributing
    • Code of Conduct
    • Software License Agreement
cuda.bindings - Home cuda.bindings - Home

cuda.bindings

  • Release Notes
  • Installation
  • Overview
  • Motivation
  • Environment Variables
  • CUDA Python API Reference
  • Tips and Tricks
  • cuda.bindings Support Policy
  • Contributing
  • Code of Conduct
  • Software License Agreement

Table of Contents

Contents:

  • Release Notes
    • 13.X.Y
    • 13.0.1
    • 13.0.0
    • 12.9.X
    • 12.9.2
    • 12.9.1
    • 12.9.0
    • 12.8.0
    • 12.6.2
    • 12.6.1
    • 12.6.0
    • 12.5.0
    • 12.4.0
    • 12.3.0
    • 12.2.1
    • 12.2.0
    • 12.1.0
    • 12.0.0
    • 11.8.7
    • 11.8.6
    • 11.8.5
    • 11.8.4
    • 11.8.3
    • 11.8.2
    • 11.8.1
    • 11.8.0
    • 11.7.1
    • 11.7.0
    • 11.6.1
    • 11.6.0
    • 11.5.0
    • 11.4.0
  • Installation
  • Overview
  • Motivation
  • Environment Variables
  • CUDA Python API Reference
    • driver
    • runtime
    • nvrtc
    • nvjitlink
    • nvvm
    • cufile
      • cuda.bindings.cufile.handle_register
      • cuda.bindings.cufile.handle_deregister
      • cuda.bindings.cufile.buf_register
      • cuda.bindings.cufile.buf_deregister
      • cuda.bindings.cufile.read
      • cuda.bindings.cufile.write
      • cuda.bindings.cufile.driver_open
      • cuda.bindings.cufile.use_count
      • cuda.bindings.cufile.driver_get_properties
      • cuda.bindings.cufile.driver_set_poll_mode
      • cuda.bindings.cufile.driver_set_max_direct_io_size
      • cuda.bindings.cufile.driver_set_max_cache_size
      • cuda.bindings.cufile.driver_set_max_pinned_mem_size
      • cuda.bindings.cufile.batch_io_set_up
      • cuda.bindings.cufile.batch_io_submit
      • cuda.bindings.cufile.batch_io_get_status
      • cuda.bindings.cufile.batch_io_cancel
      • cuda.bindings.cufile.batch_io_destroy
      • cuda.bindings.cufile.read_async
      • cuda.bindings.cufile.write_async
      • cuda.bindings.cufile.stream_register
      • cuda.bindings.cufile.stream_deregister
      • cuda.bindings.cufile.get_version
      • cuda.bindings.cufile.get_parameter_size_t
      • cuda.bindings.cufile.get_parameter_bool
      • cuda.bindings.cufile.get_parameter_string
      • cuda.bindings.cufile.set_parameter_size_t
      • cuda.bindings.cufile.set_parameter_bool
      • cuda.bindings.cufile.set_parameter_string
      • cuda.bindings.cufile.op_status_error
      • cuda.bindings.cufile.driver_close
      • cuda.bindings.cufile.IOEvents
      • cuda.bindings.cufile.Descr
      • cuda.bindings.cufile.IOParams
      • cuda.bindings.cufile.OpError
      • cuda.bindings.cufile.DriverStatusFlags
      • cuda.bindings.cufile.DriverControlFlags
      • cuda.bindings.cufile.FeatureFlags
      • cuda.bindings.cufile.FileHandleType
      • cuda.bindings.cufile.Opcode
      • cuda.bindings.cufile.Status
      • cuda.bindings.cufile.BatchMode
      • cuda.bindings.cufile.SizeTConfigParameter
      • cuda.bindings.cufile.BoolConfigParameter
      • cuda.bindings.cufile.StringConfigParameter
      • cuda.bindings.cufile.cuFileError
    • utils
      • cuda.bindings.utils.get_cuda_native_handle
      • cuda.bindings.utils.get_minimal_required_cuda_ver_from_ptx_ver
      • cuda.bindings.utils.get_ptx_ver
  • Tips and Tricks
  • cuda.bindings Support Policy
  • Contributing
  • Code of Conduct
  • Software License Agreement
  • CUDA Python API Reference
  • nvjitlink

nvjitlink#

Note#

The nvjitlink bindings are not supported on nvJitLink installations <12.3. Ensure the installed CUDA toolkit’s nvJitLink version is >=12.3.

Functions#

NvJitLink defines the following functions for linking code objects and querying the info and error logs.

cuda.bindings.nvjitlink.create(uint32_t num_options, options) → intptr_t#

nvJitLinkCreate creates an instance of nvJitLinkHandle with the given input options, and sets the output parameter handle.

Parameters:
  • num_options (uint32_t) – Number of options passed.

  • options (object) –

    Array of size num_options of option strings. It can be:

    • an int as the pointer address to the nested sequence, or

    • a Python sequence of ints, each of which is a pointer address to a valid sequence of ‘char’, or

    • a nested Python sequence of str.

Returns:

Address of nvJitLink handle.

Return type:

intptr_t

See also

nvJitLinkCreate

cuda.bindings.nvjitlink.destroy(intptr_t handle)#

nvJitLinkDestroy frees the memory associated with the given handle.

Parameters:

handle (intptr_t) – nvJitLink handle.

See also

nvJitLinkDestroy

cuda.bindings.nvjitlink.add_data(intptr_t handle, int input_type, data, size_t size, name)#

nvJitLinkAddData adds data image to the link.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • input_type (InputType) – kind of input.

  • data (bytes) – pointer to data image in memory.

  • size (size_t) – size of the data.

  • name (str) – name of input object.

See also

nvJitLinkAddData

cuda.bindings.nvjitlink.add_file(intptr_t handle, int input_type, file_name)#

nvJitLinkAddFile reads data from file and links it in.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • input_type (InputType) – kind of input.

  • file_name (str) – name of file.

See also

nvJitLinkAddFile

cuda.bindings.nvjitlink.complete(intptr_t handle)#

nvJitLinkComplete does the actual link.

Parameters:

handle (intptr_t) – nvJitLink handle.

See also

nvJitLinkComplete

cuda.bindings.nvjitlink.get_linked_cubin_size(intptr_t handle) → size_t#

nvJitLinkGetLinkedCubinSize gets the size of the linked cubin.

Parameters:

handle (intptr_t) – nvJitLink handle.

Returns:

Size of the linked cubin.

Return type:

size_t

See also

nvJitLinkGetLinkedCubinSize

cuda.bindings.nvjitlink.get_linked_cubin(intptr_t handle, cubin)#

nvJitLinkGetLinkedCubin gets the linked cubin.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • cubin (bytes) – The linked cubin.

See also

nvJitLinkGetLinkedCubin

cuda.bindings.nvjitlink.get_linked_ptx_size(intptr_t handle) → size_t#

nvJitLinkGetLinkedPtxSize gets the size of the linked ptx.

Parameters:

handle (intptr_t) – nvJitLink handle.

Returns:

Size of the linked PTX.

Return type:

size_t

See also

nvJitLinkGetLinkedPtxSize

cuda.bindings.nvjitlink.get_linked_ptx(intptr_t handle, ptx)#

nvJitLinkGetLinkedPtx gets the linked ptx.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • ptx (bytes) – The linked PTX.

See also

nvJitLinkGetLinkedPtx

cuda.bindings.nvjitlink.get_error_log_size(intptr_t handle) → size_t#

nvJitLinkGetErrorLogSize gets the size of the error log.

Parameters:

handle (intptr_t) – nvJitLink handle.

Returns:

Size of the error log.

Return type:

size_t

See also

nvJitLinkGetErrorLogSize

cuda.bindings.nvjitlink.get_error_log(intptr_t handle, log)#

nvJitLinkGetErrorLog puts any error messages in the log.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • log (bytes) – The error log.

See also

nvJitLinkGetErrorLog

cuda.bindings.nvjitlink.get_info_log_size(intptr_t handle) → size_t#

nvJitLinkGetInfoLogSize gets the size of the info log.

Parameters:

handle (intptr_t) – nvJitLink handle.

Returns:

Size of the info log.

Return type:

size_t

See also

nvJitLinkGetInfoLogSize

cuda.bindings.nvjitlink.get_info_log(intptr_t handle, log)#

nvJitLinkGetInfoLog puts any info messages in the log.

Parameters:
  • handle (intptr_t) – nvJitLink handle.

  • log (bytes) – The info log.

See also

nvJitLinkGetInfoLog

cuda.bindings.nvjitlink.version() → tuple#

nvJitLinkVersion returns the current version of nvJitLink.

Returns:

  • unsigned int: The major version.

  • unsigned int: The minor version.

Return type:

A 2-tuple containing

See also

nvJitLinkVersion

Types#

class cuda.bindings.nvjitlink.Result(
value,
names=<not given>,
*values,
module=None,
qualname=None,
type=None,
start=1,
boundary=None,
)#

See nvJitLinkResult.

SUCCESS = 0#
ERROR_UNRECOGNIZED_OPTION = 1#
ERROR_MISSING_ARCH = 2#
ERROR_INVALID_INPUT = 3#
ERROR_PTX_COMPILE = 4#
ERROR_NVVM_COMPILE = 5#
ERROR_INTERNAL = 6#
ERROR_THREADPOOL = 7#
ERROR_UNRECOGNIZED_INPUT = 8#
ERROR_FINALIZE = 9#
class cuda.bindings.nvjitlink.InputType(
value,
names=<not given>,
*values,
module=None,
qualname=None,
type=None,
start=1,
boundary=None,
)#

See nvJitLinkInputType.

NONE = 0#
CUBIN = 1#
PTX = 2#
LTOIR = 3#
FATBIN = 4#
OBJECT = 5#
LIBRARY = 6#
INDEX = 7#
ANY = 10#

previous

nvrtc

next

nvvm

On this page
  • Note
  • Functions
    • create()
    • destroy()
    • add_data()
    • add_file()
    • complete()
    • get_linked_cubin_size()
    • get_linked_cubin()
    • get_linked_ptx_size()
    • get_linked_ptx()
    • get_error_log_size()
    • get_error_log()
    • get_info_log_size()
    • get_info_log()
    • version()
  • Types
    • Result
      • SUCCESS
      • ERROR_UNRECOGNIZED_OPTION
      • ERROR_MISSING_ARCH
      • ERROR_INVALID_INPUT
      • ERROR_PTX_COMPILE
      • ERROR_NVVM_COMPILE
      • ERROR_INTERNAL
      • ERROR_THREADPOOL
      • ERROR_UNRECOGNIZED_INPUT
      • ERROR_FINALIZE
    • InputType
      • NONE
      • CUBIN
      • PTX
      • LTOIR
      • FATBIN
      • OBJECT
      • LIBRARY
      • INDEX
      • ANY
NVIDIA NVIDIA
Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2021-2025, NVIDIA.