• Stars
    star
    543
  • Rank 78,959 (Top 2 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CUDA-accelerated GIS and spatiotemporal algorithms

Β cuSpatial - GPU-Accelerated Vector Geospatial Data Analysis

Note

cuSpatial depends on cuDF and RMM from RAPIDS.

cuProj - GPU-accelerated Coordinate Reference System (CRS) Transformations

cuProj is a new RAPIDS library housed within the cuSpatial repo that provides GPU-accelerated transformations of coordinates between coordinate reference systems (CRS). cuProj is available as of release 23.10 with support for transformations of WGS84 coordinates to and from Universal Transverse Mercator (UTM) 🌐.

To learn more about cuProj, see the Python cuProj README or the c++ libcuproj README.

Resources

Overview

cuSpatial accelerates vector geospatial operations through GPU parallelization. As part of the RAPIDS libraries, cuSpatial is inherently connected to cuDF, cuML, and cuGraph, enabling GPU acceleration across entire workflows.

cuSpatial represents data in GeoArrow format, which enables compatibility with the Apache Arrow ecosystem.

cuSpatial's Python API is closely matched to GeoPandas and data can seamlessly transition between the two:

import geopandas
from shapely.geometry import Polygon
import cuspatial

p1 = Polygon([(0, 0), (1, 0), (1, 1)])
p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
geoseries = geopandas.GeoSeries([p1, p2])

cuspatial_geoseries = cuspatial.from_geopandas(geoseries)
print(cuspatial_geoseries)

Output:

0    POLYGON ((0 0, 1 0, 1 1, 0 0))
1    POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))

For additional examples, browse the complete API documentation, or check out more detailed notebooks. the NYC Taxi and Weather notebooks make use of cuSpatial.

Supported Geospatial Operations

cuSpatial is constantly working on new features! Check out the epics for a high-level view of our development, or the roadmap for the details!

Core Spatial Functions

Indexing and Join Functions

Trajectory Functions

What if operations I need aren't supported?

Thanks to the from_geopandas and to_geopandas functions you can accelerate what cuSpatial supports, and leave the rest of the workflow in place.

---
title: Integrating into Existing Workflows
---
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': false},
            'themeVariables': {'commitLabelColor': '#000000',
            'commitLabelBackground': '#ffffff',
            'commitLabelFontSize': '14px'}} }%%
gitGraph
   commit id: "Existing Workflow Start"
   commit id: "GeoPandas IO"
   commit id: "Geospatial Analytics"
   branch a
   checkout a
   commit id: "from_geopandas"
   commit id: "cuSpatial GPU Acceleration"
   branch b
   checkout b
   commit id: "cuDF"
   commit id: "cuML"
   commit id: "cuGraph"
   checkout a
   merge b
   commit id: "to_geopandas"
   checkout main
   merge a
   commit id: "Continue Work"

Using cuSpatial

CUDA/GPU requirements

Quick start: Docker

Use the RAPIDS Release Selector, selecting Docker as the installation method. All RAPIDS Docker images contain cuSpatial.

An example command from the Release Selector:

docker run --gpus all --pull always --rm -it \
    --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \
    -p 8888:8888 -p 8787:8787 -p 8786:8786 \
    nvcr.io/nvidia/rapidsai/notebooks:23.10-cuda11.8-py3.10

Install with Conda

To install via conda:

Note cuSpatial is supported only on Linux or through WSL, and with Python versions 3.9 and 3.10

cuSpatial can be installed with conda (miniconda, or the full Anaconda distribution) from the rapidsai channel:

conda install -c rapidsai -c conda-forge -c nvidia \
    cuspatial=23.10 python=3.10 cudatoolkit=11.8

We also provide nightly Conda packages built from the HEAD of our latest development branch.

See the RAPIDS installation documentation for more OS and version info.

Install with pip

To install via pip:

Note cuSpatial is supported only on Linux or through WSL, and with Python versions 3.9 and 3.10

The cuSpatial pip packages can be installed from NVIDIA's PyPI index. pip installations require using the matching wheel to the system's installed CUDA toolkit.

  • For CUDA 11 toolkits, install the -cu11 wheels
  • For CUDA 12 toolkits install the -cu12 wheels
  • If your installation has a CUDA 12 driver but a CUDA 11 toolkit, use the -cu11 wheels.
pip install cuspatial-cu12 --extra-index-url=https://pypi.nvidia.com
pip install cuspatial-cu11 --extra-index-url=https://pypi.nvidia.com

Troubleshooting Fiona/GDAL versions

cuSpatial depends on geopandas, which uses fiona >= 1.8.19, to read common GIS formats with GDAL.

Fiona requires GDAL is already present on your system, but its minimum required version may be newer than the version of GDAL in your OS's package manager.

Fiona checks the GDAL version at install time and fails with an error like this if a compatible version of GDAL isn't installed:

ERROR: GDAL >= 3.2 is required for fiona. Please upgrade GDAL.

There are two ways to fix this:

  1. Install a version of GDAL that meets fiona's minimum required version
  • Ubuntu users can install a newer GDAL with the UbuntuGIS PPA:
    sudo -y add-apt-repository ppa:ubuntugis/ppa
    sudo apt install libgdal-dev
  1. Pin fiona's version to a range that's compatible with your version of libgdal-dev
  • For Ubuntu20.04 (GDAL v3.0.4):
    pip install --no-binary fiona --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 'fiona>=1.8.19,<1.9'
  • For Ubuntu22.04 (GDAL v3.4.1):
    pip install --no-binary fiona --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 'fiona>=1.9'

Build/Install from source

To build and install cuSpatial from source please see the build documentation.

Citing cuSpatial

If you find cuSpatial useful in your published work, please consider citing the repository.

@misc{cuspatial:23.10,
    author = {{NVIDIA Corporation}},
    title = {cuSpatial: GPU-Accelerated Geospatial and Spatiotemporal Algorithms},
    year = {2023},
    publisher = {NVIDIA},
    howpublished = {\url{https://github.com/rapidsai/cuspatial}},
    note = {Software available from github.com},
}

More Repositories

1

cudf

cuDF - GPU DataFrame Library
C++
7,248
star
2

cuml

cuML - RAPIDS Machine Learning Library
C++
3,864
star
3

cugraph

cuGraph - RAPIDS Graph Analytics Library
Cuda
1,559
star
4

cusignal

cuSignal - RAPIDS Signal Processing Library
Python
703
star
5

raft

RAFT contains fundamental widely-used algorithms and primitives for machine learning and information retrieval. The algorithms are CUDA-accelerated and form building blocks for more easily writing high performance applications.
Cuda
586
star
6

notebooks

RAPIDS Sample Notebooks
Shell
577
star
7

jupyterlab-nvdashboard

A JupyterLab extension for displaying dashboards of GPU usage.
TypeScript
548
star
8

rmm

RAPIDS Memory Manager
C++
420
star
9

deeplearning

Jupyter Notebook
336
star
10

cucim

cuCIM - RAPIDS GPU-accelerated image processing library
Jupyter Notebook
302
star
11

dask-cuda

Utilities for Dask and CUDA interactions
Python
266
star
12

cuxfilter

GPU accelerated cross filtering with cuDF.
Python
261
star
13

node

GPU-accelerated data science and visualization in node
TypeScript
170
star
14

clx

A collection of RAPIDS examples for security analysts, data scientists, and engineers to quickly get started applying RAPIDS and GPU acceleration to real-world cybersecurity use cases.
Jupyter Notebook
167
star
15

libgdf

[ARCHIVED] C GPU DataFrame Library
Cuda
138
star
16

dask-cudf

[ARCHIVED] Dask support for distributed GDF object --> Moved to cudf
Python
136
star
17

cloud-ml-examples

A collection of Machine Learning examples to get started with deploying RAPIDS in the Cloud
Jupyter Notebook
134
star
18

ucx-py

Python bindings for UCX
Python
112
star
19

gpu-bdb

RAPIDS GPU-BDB
Python
103
star
20

kvikio

KvikIO - High Performance File IO
Python
100
star
21

plotly-dash-rapids-census-demo

Jupyter Notebook
92
star
22

gputreeshap

C++
83
star
23

frigate

Frigate is a tool for automatically generating documentation for your Helm charts
Python
76
star
24

wholegraph

WholeGraph - large scale Graph Neural Networks
Cuda
75
star
25

spark-examples

[ARCHIVED] Moved to github.com/NVIDIA/spark-xgboost-examples
Jupyter Notebook
70
star
26

docker

Dockerfile templates for creating RAPIDS Docker Images
Shell
62
star
27

cuvs

cuVS - a library for vector search and clustering on the GPU
Jupyter Notebook
57
star
28

custrings

[ARCHIVED] GPU String Manipulation --> Moved to cudf
Cuda
46
star
29

docs

RAPIDS Documentation Site
HTML
34
star
30

cudf-alpha

[ARCHIVED] cuDF [alpha] - RAPIDS Merge of GoAi into cuDF
34
star
31

rapids-examples

Jupyter Notebook
31
star
32

nvgraph

C++
26
star
33

rapids-cmake

CMake
24
star
34

cuhornet

Cuda
24
star
35

cuDataShader

Jupyter Notebook
22
star
36

gpuci-build-environment

Common build environment used by gpuCI for building RAPIDS
Dockerfile
19
star
37

distributed-join

C++
19
star
38

dask-cuml

[ARCHIVED] Dask support for multi-GPU machine learning algorithms --> Moved to cuml
Python
16
star
39

integration

RAPIDS - combined conda package & integration tests for all of RAPIDS libraries
Shell
15
star
40

devcontainers

Shell
15
star
41

xgboost-conda

Conda recipes for xgboost
Jupyter Notebook
12
star
42

ucxx

C++
11
star
43

benchmark

Python
10
star
44

dependency-file-generator

Python
10
star
45

helm-chart

Shell
9
star
46

deployment

RAPIDS Deployment Documentation
Jupyter Notebook
9
star
47

miniforge-cuda

Dockerfile
9
star
48

asvdb

Python
8
star
49

ci-imgs

Dockerfile
7
star
50

dask-cugraph

Python
7
star
51

rapids.ai

rapids.ai web site
HTML
7
star
52

ptxcompiler

Python
6
star
53

GaaS

Python
5
star
54

rvc

Go
4
star
55

scikit-learn-nv

Python
4
star
56

ops-bot

A Probot application used by the Ops team for automation.
TypeScript
4
star
57

workflows

Shell
4
star
58

rapids-triton

C++
4
star
59

dask-build-environment

Build environments for various dask related projects on gpuCI
Dockerfile
3
star
60

roc

GitHub utilities for the RAPIDS Ops team
Go
3
star
61

multi-gpu-tools

Shell
3
star
62

detect-weak-linking

Python
3
star
63

dask-cuda-benchmarks

Python
2
star
64

rapids_triton_pca_example

C++
2
star
65

shared-workflows

Reusable GitHub Actions workflows for RAPIDS CI
Shell
2
star
66

dgl-cugraph-build-environment

Dockerfile
2
star
67

cugunrock

Cuda
2
star
68

projects

Jupyter Notebook
2
star
69

gpuci-mgmt

Mangement scripts for gpuCI
Shell
1
star
70

ansible-roles

1
star
71

code-share

C++
1
star
72

build-metrics-reporter

Python
1
star
73

cibuildwheel-imgs

Dockerfile
1
star
74

gpuci-tools

User tools for use within the gpuCI environment
Shell
1
star
75

pynvjitlink

Python
1
star
76

rapids-dask-dependency

Shell
1
star
77

sphinx-theme

This repository contains a Sphinx theme used for RAPIDS documentation
CSS
1
star