请输入您要查询的百科知识:

 

词条 CUDA
释义

  1. Background

  2. Programming abilities

  3. Advantages

  4. Limitations

  5. GPUs supported

  6. Version features and specifications

  7. Example

  8. Benchmarks

  9. Language bindings

  10. Current and future usages of CUDA architecture

  11. See also

  12. References

  13. External links

{{Infobox software
| name = CUDA
| screenshot = Nvidia CUDA Logo.jpg
| developer = Nvidia Corporation
| released = {{Start date and age|2007|06|23}}
| latest_release_version = 10.1.105
| latest_release_date = {{Start date and age|2019|02|27}}
| operating_system = Windows, macOS, Linux
| platform = Supported GPUs
| genre = GPGPU
| license = Freeware
| website = {{URL|https://developer.nvidia.com/cuda-zone}}
}}CUDA is a parallel computing platform and application programming interface (API) model created by Nvidia.[1] It allows software developers and software engineers to use a CUDA-enabled graphics processing unit (GPU) for general purpose processing — an approach termed GPGPU (General-Purpose computing on Graphics Processing Units). The CUDA platform is a software layer that gives direct access to the GPU's virtual instruction set and parallel computational elements, for the execution of compute kernels.[2]

The CUDA platform is designed to work with programming languages such as C, C++, and Fortran. This accessibility makes it easier for specialists in parallel programming to use GPU resources, in contrast to prior APIs like Direct3D and OpenGL, which required advanced skills in graphics programming.[3] Also, CUDA supports programming frameworks such as OpenACC and OpenCL.[2] When it was first introduced by Nvidia, the name CUDA was an acronym for Compute Unified Device Architecture,[4] but Nvidia subsequently dropped the use of the acronym.

Background

{{More information|Graphics processing unit}}

The graphics processing unit (GPU), as a specialized computer processor, addresses the demands of real-time high-resolution 3D graphics compute-intensive tasks. By 2012, GPUs had evolved into highly parallel multi-core systems allowing very efficient manipulation of large blocks of data. This design is more effective than general-purpose central processing unit (CPUs) for algorithms in situations where processing large blocks of data is done in parallel, such as:

  • push-relabel maximum flow algorithm
  • fast sort algorithms of large lists
  • two-dimensional fast wavelet transform
  • molecular dynamics simulations

Programming abilities

The CUDA platform is accessible to software developers through CUDA-accelerated libraries, compiler directives such as OpenACC, and extensions to industry-standard programming languages including C, C++ and Fortran. C/C++ programmers can use 'CUDA C/C++', compiled with nvcc, Nvidia's LLVM-based C/C++ compiler.[5] Fortran programmers can use 'CUDA Fortran', compiled with the PGI CUDA Fortran compiler from The Portland Group.

In addition to libraries, compiler directives, CUDA C/C++ and CUDA Fortran, the CUDA platform supports other computational interfaces, including the Khronos Group's OpenCL,[6] Microsoft's DirectCompute, [https://www.khronos.org/opengl/wiki/Compute_Shader OpenGL Compute Shaders] and C++ AMP.[7] Third party wrappers are also available for Python, Perl, Fortran, Java, Ruby, Lua, Common Lisp, Haskell, R, MATLAB, IDL, Julia, and native support in Mathematica.

In the computer game industry, GPUs are used for graphics rendering, and for game physics calculations (physical effects such as debris, smoke, fire, fluids); examples include PhysX and Bullet. CUDA has also been used to accelerate non-graphical applications in computational biology, cryptography and other fields by an order of magnitude or more.[8][9][10][11][12]

CUDA provides both a low level API (CUDA Driver API, non single-source) and a higher level API (CUDA Runtime API, single-source). The initial CUDA SDK was made public on 15 February 2007, for Microsoft Windows and Linux. Mac OS X support was later added in version 2.0,[13] which supersedes the beta released February 14, 2008.[14] CUDA works with all Nvidia GPUs from the G8x series onwards, including GeForce, Quadro and the Tesla line. CUDA is compatible with most standard operating systems. Nvidia states that programs developed for the G8x series will also work without modification on all future Nvidia video cards, due to binary compatibility.{{Citation needed|date=January 2014}}

CUDA 8.0 comes with the following libraries (for compilation & runtime, in alphabetical order):

  • CUBLAS - CUDA Basic Linear Algebra Subroutines library, see [https://developer.nvidia.com/cublas main] and docs
  • CUDART - CUDA RunTime library, see docs
  • CUFFT - CUDA Fast Fourier Transform library, see [https://developer.nvidia.com/cufft main] and docs
  • CURAND - CUDA Random Number Generation library, see [https://developer.nvidia.com/curand main] and docs
  • CUSOLVER - CUDA based collection of dense and sparse direct solvers, see [https://developer.nvidia.com/cusolver main] and docs
  • CUSPARSE - CUDA Sparse Matrix library, see [https://developer.nvidia.com/cusparse main] and docs
  • NPP - NVIDIA Performance Primitives library, see [https://developer.nvidia.com/npp main] and docs
  • NVGRAPH - NVIDIA Graph Analytics library, see [https://developer.nvidia.com/nvgraph main] and docs
  • NVML - NVIDIA Management Library, see [https://developer.nvidia.com/nvidia-management-library-nvml main] and docs
  • NVRTC - NVIDIA RunTime Compilation library for CUDA C++, see docs

CUDA 8.0 comes with these other software components:

  • nView - NVIDIA nView Desktop Management Software, see main and docs (pdf)
  • NVWMI - NVIDIA Enterprise Management Toolkit, see [https://developer.nvidia.com/nvwmi-sdk main] and [https://developer.nvidia.com/designworks/nvwmi/downloads/2.27.3/api-reference docs] (chm)
  • PhysX - GameWorks PhysX is a multi-platform game physics engine, see [https://developer.nvidia.com/gameworks-physx-overview main] and docs

CUDA 9.0-9.2 comes with these other components:

  • CUTLASS 1.0 - custom linear algebra algorithms, see [https://news.developer.nvidia.com/cuda-9-2-now-available/ CUDA 9.2 News], [https://news.developer.nvidia.com/cutlass-fast-linear-algebra-in-cuda-c/ Developer News] and [https://devblogs.nvidia.com/cutlass-linear-algebra-cuda/ dev blog ]
  • NVCUVID - NVIDIA Video Decoder got deprecated in CUDA 9.2; it is now available in NVIDIA Video Codec SDK

CUDA 10 comes with these other components:

  • nvJPEG - Hybrid JPEG Processing, see [https://developer.nvidia.com/announcing-cuda-toolkit-10 CUDA 10 News] and [https://developer.nvidia.com/nvjpeg main] and [https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html actual Release Notes]

Advantages

CUDA has several advantages over traditional general-purpose computation on GPUs (GPGPU) using graphics APIs:

  • Scattered reads{{snd}} code can read from arbitrary addresses in memory
  • Unified virtual memory (CUDA 4.0 and above)
  • Unified memory (CUDA 6.0 and above)
  • Shared memory{{snd}} CUDA exposes a fast shared memory region that can be shared among threads. This can be used as a user-managed cache, enabling higher bandwidth than is possible using texture lookups.[15]
  • Faster downloads and readbacks to and from the GPU
  • Full support for integer and bitwise operations, including integer texture lookups

Limitations

  • Whether for the host computer or the GPU device, all CUDA source code is now processed according to C++ syntax rules.[16] This was not always the case. Earlier versions of CUDA were based on C syntax rules.[17] As with the more general case of compiling C code with a C++ compiler, it is therefore possible that old C-style CUDA source code will either fail to compile or will not behave as originally intended.
  • Interoperability with rendering languages such as OpenGL is one-way, with OpenGL having access to registered CUDA memory but CUDA not having access to OpenGL memory.
  • Copying between host and device memory may incur a performance hit due to system bus bandwidth and latency (this can be partly alleviated with asynchronous memory transfers, handled by the GPU's DMA engine)
  • Threads should be running in groups of at least 32 for best performance, with total number of threads numbering in the thousands. Branches in the program code do not affect performance significantly, provided that each of 32 threads takes the same execution path; the SIMD execution model becomes a significant limitation for any inherently divergent task (e.g. traversing a space partitioning data structure during ray tracing).
  • Unlike OpenCL, CUDA-enabled GPUs are only available from Nvidia.[18]
  • No emulator or fallback functionality is available for modern revisions.
  • Valid C++ may sometimes be flagged and prevent compilation due to the way the compiler approaches optimization for target GPU device limitations.{{citation needed|date=May 2016}}
  • C++ run-time type information (RTTI) and C++-style exception handling are only supported in host code, not in device code.
  • In single precision on first generation CUDA compute capability 1.x devices, denormal numbers are unsupported and are instead flushed to zero, and the precisions of the division and square root operations are slightly lower than IEEE 754-compliant single precision math. Devices that support compute capability 2.0 and above support denormal numbers, and the division and square root operations are IEEE 754 compliant by default. However, users can obtain the prior faster gaming-grade math of compute capability 1.x devices if desired by setting compiler flags to disable accurate divisions and accurate square roots, and enable flushing denormal numbers to zero.[19]

GPUs supported

Supported CUDA level of GPU and card. See also at Nvidia:

  • CUDA SDK 1.0 support for compute capability 1.0 – 1.1 (Tesla)[20]
  • CUDA SDK 1.1 support for compute capability 1.0 – 1.1+x (Tesla)
  • CUDA SDK 2.0 support for compute capability 1.0 – 1.1+x (Tesla)
  • CUDA SDK 2.1 – 2.3.1 support for compute capability 1.0 – 1.3 (Tesla)[21][22][23][24]
  • CUDA SDK 3.0 – 3.1 support for compute capability 1.0 – 2.0 (Tesla, Fermi)[25][26]
  • CUDA SDK 3.2 support for compute capability 1.0 – 2.1 (Tesla, Fermi)[27]
  • CUDA SDK 4.0 – 4.2 support for compute capability 1.0 – 2.1+x (Tesla, Fermi, more?)
  • CUDA SDK 5.0/5.5 support for compute capability 1.0 – 2.1+x (Tesla, Fermi, more?)
  • CUDA SDK 6.0 support for compute capability 1.0 – 3.5 (Tesla, Fermi, Kepler)
  • CUDA SDK 6.5 support for compute capability 1.1 – 5.x (Tesla, Fermi, Kepler, Maxwell). Last version with support for compute capability 1.x (Tesla)
  • CUDA SDK 7.0/7.5 support for compute capability 2.0 – 5.x (Fermi, Kepler, Maxwell)
  • CUDA SDK 8.0 support for compute capability 2.0 – 6.x (Fermi, Kepler, Maxwell, Pascal). Last version with support for compute capability 2.x (Fermi)
  • CUDA SDK 9.0 – 9.2 support for compute capability 3.0 – 7.2 (Kepler, Maxwell, Pascal, Volta)
  • CUDA SDK 10.0/10.1 support for compute capability 3.0 – 7.5 (Kepler, Maxwell, Pascal, Volta, Turing)
[28]
Compute
capability
(version)
Micro-
architecture
GPUs GeForce Quadro, NVS Tesla Tegra,
Jetson,
DRIVE
1.0Tesla G80GeForce 8800 Ultra, GeForce 8800 GTX, GeForce 8800 GTS(G80)Quadro FX 5600, Quadro FX 4600, Quadro Plex 2100 S4Tesla C870, Tesla D870, Tesla S870
1.1G92, G94, G96, G98, G84, G86GeForce GTS 250, GeForce 9800 GX2, GeForce 9800 GTX, GeForce 9800 GT, GeForce 8800 GTS(G92), GeForce 8800 GT, GeForce 9600 GT, GeForce 9500 GT, GeForce 9400 GT, GeForce 8600 GTS, GeForce 8600 GT, GeForce 8500 GT,
GeForce G110M, GeForce 9300M GS, GeForce 9200M GS, GeForce 9100M G, GeForce 8400M GT, GeForce G105M
Quadro FX 4700 X2, Quadro FX 3700, Quadro FX 1800, Quadro FX 1700, Quadro FX 580, Quadro FX 570, Quadro FX 470, Quadro FX 380, Quadro FX 370, Quadro FX 370 Low Profile, Quadro NVS 450, Quadro NVS 420, Quadro NVS 290, Quadro NVS 295, Quadro Plex 2100 D4,
Quadro FX 3800M, Quadro FX 3700M, Quadro FX 3600M, Quadro FX 2800M, Quadro FX 2700M, Quadro FX 1700M, Quadro FX 1600M, Quadro FX 770M, Quadro FX 570M, Quadro FX 370M, Quadro FX 360M, Quadro NVS 320M, Quadro NVS 160M, Quadro NVS 150M, Quadro NVS 140M, Quadro NVS 135M, Quadro NVS 130M, Quadro NVS 450, Quadro NVS 420[29], Quadro NVS 295
1.2GT218, GT216, GT215GeForce GT 340*, GeForce GT 330*, GeForce GT 320*, GeForce 315*, GeForce 310*, GeForce GT 240, GeForce GT 220, GeForce 210,
GeForce GTS 360M, GeForce GTS 350M, GeForce GT 335M, GeForce GT 330M, GeForce GT 325M, GeForce GT 240M, GeForce G210M, GeForce 310M, GeForce 305M
Quadro FX 380 Low Profile, Nvidia NVS 300, Quadro FX 1800M, Quadro FX 880M, Quadro FX 380M, Nvidia NVS 300, NVS 5100M, NVS 3100M, NVS 2100M, ION
1.3GT200, GT200bGeForce GTX 295, GTX 285, GTX 280, GeForce GTX 275, GeForce GTX 260Quadro FX 5800, Quadro FX 4800, Quadro FX 4800 for Mac, Quadro FX 3800, Quadro CX, Quadro Plex 2200 D2Tesla C1060, Tesla S1070, Tesla M1060
2.0FermiGF100, GF110GeForce GTX 590, GeForce GTX 580, GeForce GTX 570, GeForce GTX 480, GeForce GTX 470, GeForce GTX 465, GeForce GTX 480MQuadro 6000, Quadro 5000, Quadro 4000, Quadro 4000 for Mac, Quadro Plex 7000, Quadro 5010M, Quadro 5000MTesla C2075, Tesla C2050/C2070, Tesla M2050/M2070/M2075/M2090
2.1GF104, GF106 GF108, GF114, GF116, GF117, GF119GeForce GTX 560 Ti, GeForce GTX 550 Ti, GeForce GTX 460, GeForce GTS 450, GeForce GTS 450*, GeForce GT 640 (GDDR3), GeForce GT 630, GeForce GT 620, GeForce GT 610, GeForce GT 520, GeForce GT 440, GeForce GT 440*, GeForce GT 430, GeForce GT 430*, GeForce GT 420*,
GeForce GTX 675M, GeForce GTX 670M, GeForce GT 635M, GeForce GT 630M, GeForce GT 625M, GeForce GT 720M, GeForce GT 620M, GeForce 710M, GeForce 610M, GeForce 820M, GeForce GTX 580M, GeForce GTX 570M, GeForce GTX 560M, GeForce GT 555M, GeForce GT 550M, GeForce GT 540M, GeForce GT 525M, GeForce GT 520MX, GeForce GT 520M, GeForce GTX 485M, GeForce GTX 470M, GeForce GTX 460M, GeForce GT 445M, GeForce GT 435M, GeForce GT 420M, GeForce GT 415M, GeForce 710M, GeForce 410M
Quadro 2000, Quadro 2000D, Quadro 600, Quadro 4000M, Quadro 3000M, Quadro 2000M, Quadro 1000M, NVS 310, NVS 315, NVS 5400M, NVS 5200M, NVS 4200M
3.0KeplerGK104, GK106, GK107GeForce GTX 770, GeForce GTX 760, GeForce GT 740, GeForce GTX 690, GeForce GTX 680, GeForce GTX 670, GeForce GTX 660 Ti, GeForce GTX 660, GeForce GTX 650 Ti BOOST, GeForce GTX 650 Ti, GeForce GTX 650,
GeForce GTX 880M, GeForce GTX 780M, GeForce GTX 770M, GeForce GTX 765M, GeForce GTX 760M, GeForce GTX 680MX, GeForce GTX 680M, GeForce GTX 675MX, GeForce GTX 670MX, GeForce GTX 660M, GeForce GT 750M, GeForce GT 650M, GeForce GT 745M, GeForce GT 645M, GeForce GT 740M, GeForce GT 730M, GeForce GT 640M, GeForce GT 640M LE, GeForce GT 735M, GeForce GT 730M
Quadro K5000, Quadro K4200, Quadro K4000, Quadro K2000, Quadro K2000D, Quadro K600, Quadro K420, Quadro K500M, Quadro K510M, Quadro K610M, Quadro K1000M, Quadro K2000M, Quadro K1100M, Quadro K2100M, Quadro K3000M, Quadro K3100M, Quadro K4000M, Quadro K5000M, Quadro K4100M, Quadro K5100M, NVS 510, Quadro 410Tesla K10, GRID K340, GRID K520
3.2GK20ATegra K1,
Jetson TK1
3.5GK110, GK208GeForce GTX Titan Z, GeForce GTX Titan Black, GeForce GTX Titan, GeForce GTX 780 Ti, GeForce GTX 780, GeForce GT 640 (GDDR5), GeForce GT 630 v2, GeForce GT 730, GeForce GT 720, GeForce GT 710, GeForce GT 740M (64-bit, DDR3), GeForce GT 920MQuadro K6000, Quadro K5200Tesla K40, Tesla K20x, Tesla K20
3.7GK210 Tesla K80
5.0MaxwellGM107, GM108GeForce GTX 750 Ti, GeForce GTX 750, GeForce GTX 960M, GeForce GTX 950M, GeForce 940M, GeForce 930M, GeForce GTX 860M, GeForce GTX 850M, GeForce 845M, GeForce 840M, GeForce 830M, GeForce GTX 870MQuadro K1200, Quadro K2200, Quadro K620, Quadro M2000M, Quadro M1000M, Quadro M600M, Quadro K620M, NVS 810Tesla M10
5.2GM200, GM204, GM206GeForce GTX Titan X, GeForce GTX 980 Ti, GeForce GTX 980, GeForce GTX 970, GeForce GTX 960, GeForce GTX 950, GeForce GTX 750 SE, GeForce GTX 980M, GeForce GTX 970M, GeForce GTX 965MQuadro M6000 24GB, Quadro M6000, Quadro M5000, Quadro M4000, Quadro M2000, Quadro M5500, Quadro M5000M, Quadro M4000M, Quadro M3000MTesla M4, Tesla M40, Tesla M6, Tesla M60
5.3GM20BTegra X1,
Jetson TX1,
DRIVE CX,
DRIVE PX
6.0PascalGP100 Quadro GP100 Tesla P100
6.1GP102, GP104, GP106, GP107, GP108Nvidia TITAN Xp, Titan X, GeForce GTX 1080 Ti, GTX 1080, GTX 1070 Ti, GTX 1070, GTX 1060, GTX 1050 Ti, GTX 1050, GT 1030, MX150Quadro P6000, Quadro P5000, Quadro P4000, Quadro P2000, Quadro P1000, Quadro P600, Quadro P400, Quadro P5000(Mobile), Quadro P4000(Mobile), Quadro P3000(Mobile)Tesla P40, Tesla P6, Tesla P4
6.2GP10B[30]Tegra X2, Jetson TX2, DRIVE PX 2
7.0VoltaGV100NVIDIA TITAN VQuadro GV100Tesla V100
7.2GV10B[31]Tegra Xavier,
Jetson AGX Xavier, DRIVE AGX Xavier, DRIVE AGX Pegasus
7.5TuringTU102, TU104, TU106, TU116, TU117NVIDIA TITAN RTX, GeForce RTX 2080 Ti, RTX 2080, RTX 2070, RTX 2060, GTX 1660 Ti, GTX 1660, GTX 1650Quadro RTX 8000, Quadro RTX 6000, Quadro RTX 5000, Quadro RTX 4000, Quadro T2000, Quadro T1000Tesla T4
8.0

'*' – OEM-only products

Version features and specifications

Feature support (unlisted features are supported for all compute abilities)Compute capability (version)
1.0 1.1 1.2 1.3 2.x 3.0 3.2 3.5, 3.7, 5.0, 5.2 5.3 6.x 7.0/2
(Volta)
7.5
(Turing)
Integer atomic functions operating on 32-bit words in global memory colspan="1" rowspan="2" {{no}} colspan="11" rowspan="2" {{yes}}
atomicExch() operating on 32-bit floating point values in global memory
Integer atomic functions operating on 32-bit words in shared memory colspan="2" rowspan="4" {{no}} colspan="10" rowspan="4" {{yes}}
atomicExch() operating on 32-bit floating point values in shared memory
Integer atomic functions operating on 64-bit words in global memory
Warp vote functions
Double-precision floating-point operations colspan="3" rowspan="1" {{no}} colspan="9" rowspan="1" {{yes}}
Atomic functions operating on 64-bit integer values in shared memory colspan="4" rowspan="7" {{no}} colspan="8" rowspan="7" {{yes}}
Floating-point atomic addition operating on 32-bit words in global and shared memory
_ballot()
_threadfence_system()
_syncthreads_count(), _syncthreads_and(), _syncthreads_or()
Surface functions
3D grid of thread block
Warp shuffle functions colspan="5" rowspan="1" {{no}} colspan="7" rowspan="1" {{yes}}
Funnel shift colspan="6" rowspan="1" {{no}} colspan="6" rowspan="1" {{yes}}
Dynamic parallelism colspan="7" rowspan="1" {{no}} colspan="5" rowspan="1" {{yes}}
Half-precision floating-point operations:
addition, subtraction, multiplication, comparison, warp shuffle functions, conversion
colspan="8" rowspan="1" {{no}} colspan="4" rowspan="1" {{yes}}
Atomic addition operating on 64-bit floating point values in global memory and shared memory colspan="9" rowspan="1" {{no}} colspan="3" rowspan="1" {{yes}}
Tensor core colspan="10" rowspan="1" {{no}} colspan="2" rowspan="1" {{yes}}
[32]
Data Type Operation Supported since Supported since
for global memory
Supported since
for shared memory
16-bit integer general operations
32-bit integer atomic functions 1.1 1.2
64-bit integer atomic functions 1.2 2.0
16-bit floating point addition, subtraction,
multiplication, comparison,
warp shuffle functions, conversion
5.3
32-bit floating point atomicExch() 1.1 1.2
32-bit floating point atomic addition 2.0 2.0
64-bit floating point general operations 1.3
64-bit floating point atomic addition 6.0 6.0
tensor core 7.0

Note: Any missing lines or empty entries do reflect some lack of information on that exact item.

[33]
Technical specificationsCompute capability (version)
1.0 1.1 1.2 1.3 2.x 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.1 6.2 7.0
(7.2?)
7.5
Maximum number of resident grids per device
(concurrent kernel execution)
t.b.d.}}16}}4}}32}}16}}128}}32}}16}}128}}
Maximum dimensionality of grid of thread blocks2}}3}}
Maximum x-dimension of a grid of thread blocks65535}}231 − 1}}
Maximum y-, or z-dimension of a grid of thread blocks65535}}
Maximum dimensionality of thread block3}}
Maximum x- or y-dimension of a block512}}1024}}
Maximum z-dimension of a block64}}
Maximum number of threads per block512}}1024}}
Warp size32}}
Maximum number of resident blocks per multiprocessor8}}16}}32}}16}}
Maximum number of resident warps per multiprocessor24}}32}}48}}64}}32}}
Maximum number of resident threads per multiprocessor768}}1024}}1536}}2048}}1024}}
Number of 32-bit registers per multiprocessor8 K}}16 K}}32 K}}64 K}}128 K}}64 K}}
Maximum number of 32-bit registers per thread block colspan="4" {{n/a}}32 K}}64 K}}32 K}}64 K}}32 K}}64 K}}32 K}}64 K}}
Maximum number of 32-bit registers per thread124}}63}}255}}
Maximum amount of shared memory per multiprocessor16 KB}}48 KB}}112 KB}}64 KB}}96 KB}}64 KB}}96 KB}}64 KB}}96 KB
(of 128)}}
64 KB
(of 96)}}
Maximum amount of shared memory per thread block48 KB}}48/96 KB}}64 KB}}
Number of shared memory banks16}}32}}
Amount of local memory per thread16 KB}}512 KB}}
Constant memory size64 KB}}
Cache working set per multiprocessor for constant memory8 KB}}4 KB}}8 KB}}
Cache working set per multiprocessor for texture memory6 – 8 KB}}12 KB}}12 – 48 KB}}24 KB}}48 KB}} colspan="1" {{n/a}}24 KB}}48 KB}}24 KB}}32 – 128 KB}}32 – 64 KB}}
Maximum width for 1D texture reference bound to a CUDA
array
8192}}65536}}
Maximum width for 1D texture reference bound to linear
memory
227}}
Maximum width and number of layers for a 1D layered
texture reference
8192 × 512}}16384 × 2048}}
Maximum width and height for 2D texture reference bound
to a CUDA array
65536 × 32768}}65536 × 65535}}
Maximum width and height for 2D texture reference bound
to a linear memory
650002}}
Maximum width and height for 2D texture reference bound
to a CUDA array supporting texture gather
colspan="4" {{n/a}}163842}}
Maximum width, height, and number of layers for a 2D
layered texture reference
8192 × 8192 × 512}}16384 × 16384 × 2048}}
Maximum width, height and depth for a 3D texture
reference bound to linear memory or a CUDA array
20483}}40963}}
Maximum width and number of layers for a cubemap
layered texture reference
colspan="4" {{n/a}}16384 × 2046}}
Maximum number of textures that can be bound to a
kernel
128}}256}}
Maximum width for a 1D surface reference bound to a
CUDA array
Not
supported}}
65536}}
Maximum width and number of layers for a 1D layered
surface reference
65536 × 2048}}
Maximum width and height for a 2D surface reference
bound to a CUDA array
65536 × 32768}}
Maximum width, height, and number of layers for a 2D
layered surface reference
65536 × 32768 × 2048}}
Maximum width, height, and depth for a 3D surface
reference bound to a CUDA array
65536 × 32768 × 2048}}
Maximum width and number of layers for a cubemap
layered surface reference
32768 × 2046}}
Maximum number of surfaces that can be bound to a
kernel
8}}16}}
Maximum number of instructions per kernel2 million}}512 million}}
[34]
Architecture specificationsCompute capability (version)
1.0 1.1 1.2 1.3 2.0 2.1 3.0 3.5 3.7 5.0 5.2 6.0 6.1, 6.2 7.0/2
(Volta)
7.5
(Turing)
Number of ALU lanes for integer and single-precision floating-point arithmetic operations8}}[35]32}}48}}192}}128}}64}}128}}64}}
Number of special function units for single-precision floating-point transcendental functions2}}4}}8}}32}}16}}32}}16}}
Number of texture filtering units for every texture address unit or render output unit (ROP)2}}4}}8}}16}}8}}[36]
Number of warp schedulers1}}2}}4}}2}}4}}
Max number of instructions issued at once by a single scheduler1}}2}}[37]1}}
Number of tensor cores colspan="13" {{n/a}}8}}[38]
Size in kB of unified memory for data cache and shared memory per multi processort.b.d.128}}96}}[39]
[40]

For more information see the article: {{cite web|url=http://www.geeks3d.com/20100606/gpu-computing-nvidia-cuda-compute-capability-comparative-table/|title=(GPU Computing) NVIDIA CUDA Compute Capability Comparative Table|author=JeGX|publisher=Geeks3D|date=2010-06-06|access-date=2017-08-08}} and read Nvidia CUDA programming guide.[41]

Example

This example code in C++ loads a texture from an image into an array on the GPU:

texture tex;

void foo()

{
  // Allocate array  cudaChannelFormatDesc description = cudaCreateChannelDesc();  cudaMallocArray(&cu_array, &description, width, height);
  // Copy image data to array  cudaMemcpyToArray(cu_array, image, width*height*sizeof(float), cudaMemcpyHostToDevice);
  // Set texture parameters (default)  tex.addressMode[0] = cudaAddressModeClamp;  tex.addressMode[1] = cudaAddressModeClamp;  tex.filterMode = cudaFilterModePoint;  tex.normalized = false; // do not normalize coordinates
  // Bind the array to the texture  cudaBindTextureToArray(tex, cu_array);
  // Run kernel  dim3 blockDim(16, 16, 1);  dim3 gridDim((width + blockDim.x - 1)/ blockDim.x, (height + blockDim.y - 1) / blockDim.y, 1);  kernel<<< gridDim, blockDim, 0 >>>(d_data, height, width);
  // Unbind the array from the texture  cudaUnbindTexture(tex);

} //end foo()

__global__ void kernel(float* odata, int height, int width)

{
   unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;   unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;   if (x < width && y < height) {      float c = tex2D(tex, x, y);      odata[y*width+x] = c;   }

}

Below is an example given in Python that computes the product of two arrays on the GPU. The unofficial Python language bindings can be obtained from PyCUDA.[42]

import pycuda.compiler as comp

import pycuda.driver as drv

import numpy

import pycuda.autoinit

mod = comp.SourceModule("""

__global__ void multiply_them(float *dest, float *a, float *b)

{
  const int i = threadIdx.x;  dest[i] = a[i] * b[i];

}

""")

multiply_them = mod.get_function("multiply_them")

a = numpy.random.randn(400).astype(numpy.float32)

b = numpy.random.randn(400).astype(numpy.float32)

dest = numpy.zeros_like(a)

multiply_them(

        drv.Out(dest), drv.In(a), drv.In(b),        block=(400,1,1))

print dest-a*b

Additional Python bindings to simplify matrix multiplication operations can be found in the program pycublas.[43]

import numpy

from pycublas import CUBLASMatrix

A = CUBLASMatrix( numpy.mat(1,2,3],[4,5,6,numpy.float32) )

B = CUBLASMatrix( numpy.mat(2,3],[4,5],[6,7,numpy.float32) )

C = A*B

print C.np_mat()

Benchmarks

There are some open-source benchmarks containing CUDA codes

  • [https://github.com/yuhc/gpu-rodinia Rodinia benchmarks]
  • [https://github.com/vetter/shoc SHOC]
  • Tensor module in Eigen 3.0 open-source C++ template library for linear algebra.
  • [https://github.com/bennylp/saxpy-benchmark SAXPY benchmark]

Language bindings

  • Common Lisp – [https://github.com/takagi/cl-cuda cl-cuda]
  • Clojure – [https://clojurecuda.uncomplicate.org ClojureCUDA]
  • Fortran – FORTRAN CUDA, PGI CUDA Fortran Compiler
  • F# – [https://web.archive.org/web/20141010163529/https://www.quantalea.net/products/introduction/ Alea.CUDA]
  • Haskell – Data.Array.Accelerate
  • IDL – GPULib
  • Java – jCUDA, JCuda, JCublas, JCufft, CUDA4J
  • Julia – [https://juliagpu.github.io/CUDAnative.jl/stable/ CUDAnative.jl][44]
  • Lua – [https://web.archive.org/web/20160815110157/https://psilambda.com/download/kappa-extras/ KappaCUDA]
  • Mathematica – CUDALink
  • MATLAB – Parallel Computing Toolbox, MATLAB Distributed Computing Server,[45] and 3rd party packages like Jacket.
  • .NET – CUDA.NET, [https://kunzmi.github.io/managedCuda/ Managed CUDA], [https://archive.codeplex.com/?p=cudafy CUDAfy.NET] .NET kernel and host code, CURAND, CUBLAS, CUFFT
  • Perl – [https://web.archive.org/web/20100825231711/http://psilambda.com/download/kappa-for-perl/ KappaCUDA], [https://github.com/run4flat/perl-CUDA-Minimal CUDA::Minimal], [https://metacpan.org/pod/AI::MXNet::CudaKernel AI::MXNet::CudaKernel]
  • Python – Numba, NumbaPro, PyCUDA, [https://web.archive.org/web/20160815113344/https://psilambda.com/download/kappa-for-python/ KappaCUDA], Theano
  • Ruby – [https://web.archive.org/web/20160815110157/https://psilambda.com/download/kappa-extras/ KappaCUDA] (Broken link)
  • R – [https://github.com/gpuRcore/gpuRcuda gpuRcuda]

Current and future usages of CUDA architecture

  • Accelerated rendering of 3D graphics
  • Accelerated interconversion of video file formats
  • Accelerated encryption, decryption and compression
  • Bioinformatics, e.g. NGS DNA sequencing BarraCUDA
  • Distributed calculations, such as predicting the native conformation of proteins
  • Medical analysis simulations, for example virtual reality based on CT and MRI scan images.
  • Physical simulations, in particular in fluid dynamics.
  • Neural network training in machine learning problems
  • Face recognition
  • Distributed computing
  • Molecular dynamics
  • Mining cryptocurrencies
  • Structure from motion (SfM) software

See also

  • OpenCL – An open standard from Khronos Group for programming a variety of platforms, including GPUs, similar to lower-level CUDA Driver API (non single-source)
  • SYCL – An open standard from Khronos Group for programming a variety of platforms, including GPUs, with single-source modern C++, similar to higher-level CUDA Runtime API (single-source)
  • BrookGPU – the Stanford University graphics group's compiler
  • Array programming
  • Parallel computing
  • Stream processing
  • rCUDA – An API for computing on remote computers
  • Molecular modeling on GPU
  • Vulkan

References

1. ^{{cite web|url=http://www.nvidia.com/object/cuda_home_new.html|title=Nvidia CUDA Home Page}}
2. ^{{cite web|url=http://www.tomshardware.com/reviews/nvidia-cuda-gpu,1954.html|title=Nvidia's CUDA: The End of the CPU?|last=Abi-Chahla|first=Fedy|date=June 18, 2008|publisher=Tom's Hardware|accessdate=May 17, 2015}}
3. ^{{Cite news|url=https://www.videomaker.com/article/c15/19313-cuda-vs-opencl-vs-opengl|title=CUDA vs. OpenCL vs. OpenGL|last=Zunitch|first=Peter|date=2018-01-24|work=Videomaker|access-date=2018-09-16|language=en-US}}
4. ^{{cite web|url=http://www.anandtech.com/show/2116/8|title=Nvidia's GeForce 8800 (G80): GPUs Re-architected for DirectX 10|last1=Shimpi|first1=Anand Lal|last2=Wilson|first2=Derek|date=November 8, 2006|publisher=AnandTech|accessdate=May 16, 2015}}
5. ^{{cite web|url=http://developer.nvidia.com/cuda/cuda-llvm-compiler|title=CUDA LLVM Compiler}}
6. ^{{YouTube|r1sN1ELJfNo|First OpenCL demo on a GPU}}
7. ^{{YouTube|K1I4kts5mqc|DirectCompute Ocean Demo Running on Nvidia CUDA-enabled GPU}}
8. ^{{cite journal|last1=Vasiliadis |first1=Giorgos |last2=Antonatos |first2=Spiros |last3=Polychronakis |first3=Michalis |last4=Markatos |first4=Evangelos P. |last5=Ioannidis |first5=Sotiris |title= Gnort: High Performance Network Intrusion Detection Using Graphics Processors |journal= Proceedings of the 11th International Symposium on Recent Advances in Intrusion Detection (RAID) |date=September 2008 |url= http://www.ics.forth.gr/dcs/Activities/papers/gnort.raid08.pdf }}
9. ^{{cite journal |last1=Schatz |first1=Michael C. |last2=Trapnell |first2=Cole |last3=Delcher |first3=Arthur L. |last4=Varshney |first4=Amitabh |year= 2007 |title= High-throughput sequence alignment using Graphics Processing Units |journal= BMC Bioinformatics |volume= 8|doi= 10.1186/1471-2105-8-474 |pages= 474 |pmid= 18070356 |pmc= 2222658}}
10. ^{{cite journal|last1= Manavski |first1= Svetlin A. |last2=Giorgio |first2=Valle |title= CUDA compatible GPU cards as efficient hardware accelerators for Smith-Waterman sequence alignment |journal= BMC Bioinformatics |volume= 10 |year= 2008 |doi= 10.1186/1471-2105-9-S2-S10 |pages= S10 |pmid= 18387198 |pmc= 2323659}}
11. ^{{cite web|url=https://code.google.com/p/pyrit/|title=Pyrit – Google Code}}
12. ^{{cite web|url=http://boinc.berkeley.edu/cuda.php|title=Use your Nvidia GPU for scientific computing|archive-url=https://web.archive.org/web/20081228022142/http://boinc.berkeley.edu/cuda.php|archive-date=2008-12-28|dead-url=yes|access-date=2017-08-08|publisher=BOINC|date=2008-12-18}}
13. ^{{cite web|url=http://developer.download.nvidia.com/compute/cuda/sdk/website/doc/CUDA_SDK_release_notes_macosx.txt|title=Nvidia CUDA Software Development Kit (CUDA SDK) – Release Notes Version 2.0 for MAC OS X|deadurl=yes|archiveurl=https://web.archive.org/web/20090106020401/http://developer.download.nvidia.com/compute/cuda/sdk/website/doc/CUDA_SDK_release_notes_macosx.txt|archivedate=2009-01-06|df=}}
14. ^{{cite web|url=http://news.developer.nvidia.com/2008/02/cuda-11---now-o.html|title=CUDA 1.1 – Now on Mac OS X|date=February 14, 2008|deadurl=yes|archiveurl=https://web.archive.org/web/20081122105633/http://news.developer.nvidia.com/2008/02/cuda-11---now-o.html|archivedate=November 22, 2008|df=}}
15. ^{{cite conference|doi=10.1145/1375527.1375572|title=Efficient computation of sum-products on GPUs through software-managed cache|conference=Proceedings of the 22nd annual international conference on Supercomputing – ICS '08|year=2008|last1=Silberstein|first1=Mark|last2=Schuster|first2=Assaf|author2-link= Assaf Schuster |last3=Geiger|first3=Dan|last4=Patney|first4=Anjul|last5=Owens|first5=John D.|isbn=978-1-60558-158-3|pages=309–318}}
16. ^{{cite web|title=CUDA Toolkit Documentation|url=http://docs.nvidia.com/cuda/pdf/CUDA_C_Programming_Guide.pdf|website=nVidia Developer Zone - CUDA C Programming Guide v8.0|accessdate=22 March 2017|location=Section 3.1.5|page=19|date=January 2017}}
17. ^{{cite web|url=https://devtalk.nvidia.com/default/topic/508479/cuda-programming-and-performance/nvcc-forces-c-compilation-of-cu-files/#entry1340190|title=NVCC forces c++ compilation of .cu files}}
18. ^{{cite web |url=http://www.nvidia.com/object/cuda_learn_products.html |title=CUDA-Enabled Products |work=CUDA Zone |publisher=Nvidia Corporation |accessdate=2008-11-03}}
19. ^{{Cite web|url=https://developer.nvidia.com/sites/default/files/akamai/cuda/files/NVIDIA-CUDA-Floating-Point.pdf |first1=Nathan |last1=Whitehead |first2=Alex |last2=Fit-Florea |title=Precision & Performance: Floating Point and IEEE 754 Compliance for Nvidia GPUs |accessdate=November 18, 2014 |publisher=Nvidia}}
20. ^http://developer.download.nvidia.com/compute/cuda/1.0/NVIDIA_CUDA_Programming_Guide_1.0.pdf
21. ^http://developer.download.nvidia.com/compute/cuda/2_1/toolkit/docs/NVIDIA_CUDA_Programming_Guide_2.1.pdf
22. ^http://developer.download.nvidia.com/compute/cuda/2_2/toolkit/docs/NVIDIA_CUDA_Programming_Guide_2.2.pdf
23. ^http://developer.download.nvidia.com/compute/cuda/2_21/toolkit/docs/NVIDIA_CUDA_Programming_Guide_2.2.1.pdf
24. ^http://developer.download.nvidia.com/compute/cuda/2_3/toolkit/docs/NVIDIA_CUDA_Programming_Guide_2.3.pdf
25. ^http://developer.download.nvidia.com/compute/cuda/3_0/toolkit/docs/NVIDIA_CUDA_ProgrammingGuide.pdf
26. ^http://developer.download.nvidia.com/compute/cuda/3_1/toolkit/docs/NVIDIA_CUDA_C_ProgrammingGuide_3.1.pdf
27. ^http://developer.download.nvidia.com/compute/cuda/3_2_prod/toolkit/docs/CUDA_C_Programming_Guide.pdf
28. ^https://developer.nvidia.com/cuda-toolkit-archive
29. ^https://www.techpowerup.com/gpu-specs/quadro-nvs-420.c1448
30. ^{{cite web|url=http://www.phoronix.com/scan.php?page=news_item&px=Tegra-X2-Nouveau-Support|title=NVIDIA Rolls Out Tegra X2 GPU Support In Nouveau|last=Larabel|first=Michael|author-link=Michael Larabel|publisher=Phoronix|date=March 29, 2017|access-date=August 8, 2017}}
31. ^[https://www.techpowerup.com/gpudb/3232/xavier Nvidia Xavier Specs] on TechPowerUp (preliminary)
32. ^[https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications H.1. Features and Technical Specifications - Table 13. Feature Support per Compute Capability]
33. ^https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications
34. ^[https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications H.1. Features and Technical Specifications - Table 14. Technical Specifications per Compute Capability]
35. ^ALUs perform only single-precision floating-point arithmetics. There is 1 double-precision floating-point unit.
36. ^[https://devblogs.nvidia.com/inside-volta/ Inside Volta] on Nvidia DevBlogs
37. ^No more than one scheduler can issue 2 instructions at once. The first scheduler is in charge of warps with odd IDs. The second scheduler is in charge of warps with even IDs.
38. ^[https://devblogs.nvidia.com/inside-volta/ Inside Volta] on Nvidia DevBlogs
39. ^https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#architecture-7-x
40. ^[https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-capability-7-x H.6. Compute Capability 7.x]
41. ^{{cite web|url= http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Programming_Guide.pdf |title=Appendix F. Features and Technical Specifications }} {{small|(3.2 MiB)}}, Page 148 of 175 (Version 5.0 October 2012)
42. ^{{cite web|url=http://mathema.tician.de/software/pycuda|title=PyCUDA}}
43. ^{{cite web|url=http://kered.org/blog/2009-04-13/easy-python-numpy-cuda-cublas/|title=pycublas|archive-url=https://web.archive.org/web/20090420124748/http://kered.org/blog/2009-04-13/easy-python-numpy-cuda-cublas/|archive-date=2009-04-20|dead-url=yes|access-date=2017-08-08}}
44. ^https://devblogs.nvidia.com/gpu-computing-julia-programming-language/
45. ^{{cite web|title=MATLAB Adds GPGPU Support|url=http://www.hpcwire.com/features/MATLAB-Adds-GPGPU-Support-103307084.html|date=2010-09-20|deadurl=yes|archiveurl=https://web.archive.org/web/20100927155948/http://www.hpcwire.com/features/MATLAB-Adds-GPGPU-Support-103307084.html|archivedate=2010-09-27|df=}}

External links

  • {{Official website}}
  • [https://plus.google.com/communities/114632076318201174454 CUDA Community] on Google+
  • [https://devtalk.nvidia.com/default/topic/726765/need-a-little-tool-to-adjust-the-vram-size/ A little tool to adjust the VRAM size]
{{Nvidia}}{{CPU technologies}}{{Parallel computing}}{{Authority control}}{{DEFAULTSORT:Cuda}}

8 : Computer physics engines|GPGPU|GPGPU libraries|Graphics hardware|Nvidia software|Parallel computing|Video cards|Video game hardware

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/10 21:23:55