Skip to content

Instantly share code, notes, and snippets.

@epifanio
Created January 29, 2023 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epifanio/3d161abd957b5045f0beafbfcf1d600d to your computer and use it in GitHub Desktop.
Save epifanio/3d161abd957b5045f0beafbfcf1d600d to your computer and use it in GitHub Desktop.
#!/bin/bash
. /opt/conda/etc/profile.d/conda.sh
conda activate base
git clone https://github.com/epifanio/cuspatial /home/jovyan/cuspatial && cd /home/jovyan/cuspatial && git checkout gdal362
export CUSPATIAL_HOME=/home/jovyan/cuspatial
conda env create --name all_cuda-118_arch-x86_64 --file conda/environments/all_cuda-118_arch-x86_64.yaml
from PyQt5.QtWidgets import *
import cudf
import cuspatial
print("cudf version: ", cudf.__version__)
print("cuspatial version: ", cuspatial.__version__)
from qgis.gui import (
QgsMapCanvas,
)
app = QApplication([])
canvas = QgsMapCanvas()
canvas.setCanvasColor(Qt.white)
canvas.enableAntiAliasing(True)
canvas.show()
app.exec()
version: "3.5"
services:
app:
image: epinux/qt:desktop
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- DISPLAY=${DISPLAY}
- XAUTH_TOKEN=7873348a5b48f441622aeb7c5c971e2a
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./demo.py:/home/jovyan/demo.py
- ./start_app.sh:/home/jovyan/start_app.sh
#- ../../:/hbc_browser/
- ${HOME}:/home/${USER}/host
# - /media/epinux/media:/home/${USER}/media
network_mode: host
# make sure that :
# start_app.sh points to an available qt app, amd
# run "xhost +local:" on the host machine
entrypoint: "/bin/bash --login -c"
command: "/home/jovyan/start_app.sh"
ARG MOTHER=epinux/jammy_mamba_gpu:desktop
FROM $MOTHER
LABEL maintainer="massimods@met.no"
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN mamba install --yes git
COPY build_cuspatial.sh /home/jovyan/build_cuspatial.sh
RUN sh /home/jovyan/build_cuspatial.sh
SHELL ["conda", "run", "-n", "all_cuda-118_arch-x86_64", "/bin/bash", "-c"]
RUN cd /home/jovyan/cuspatial && chmod a+x build.sh && ./build.sh
RUN mamba install -y simplekml \
pyqtgraph \
qdarkstyle \
pyqt \
pyqt5-sip \
pyqtchart \
pyqtwebengine \
pyopengl \
qgis
RUN mamba install -y geopandas pytest shapely
WORKDIR $HOME
RUN touch ~/.Xauthority
# COPY demo.py /home/jovyan/start_app.sh
# COPY demo.py /home/jovyan/demo.py
# SHELL ["/bin/bash", "--login", "-c"]
# CMD ["/home/jovyan/start_app.sh"]
#!/bin/bash
. /opt/conda/etc/profile.d/conda.sh
conda activate all_cuda-118_arch-x86_64
xauth add $DISPLAY . $XAUTH_TOKEN
python --version
which python
nvidia-smi
python /home/jovyan/demo.py
app_1 | Python 3.10.8
app_1 | /opt/conda/envs/all_cuda-118_arch-x86_64/bin/python
app_1 | Sun Jan 29 11:09:32 2023
app_1 | +-----------------------------------------------------------------------------+
app_1 | | NVIDIA-SMI 525.85.05 Driver Version: 525.85.05 CUDA Version: 12.0 |
app_1 | |-------------------------------+----------------------+----------------------+
app_1 | | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
app_1 | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
app_1 | | | | MIG M. |
app_1 | |===============================+======================+======================|
app_1 | | 0 NVIDIA GeForce ... Off | 00000000:0D:00.0 On | Off |
app_1 | | 0% 21C P8 15W / 450W | 1054MiB / 24564MiB | 17% Default |
app_1 | | | | N/A |
app_1 | +-------------------------------+----------------------+----------------------+
app_1 |
app_1 | +-----------------------------------------------------------------------------+
app_1 | | Processes: |
app_1 | | GPU GI CI PID Type Process name GPU Memory |
app_1 | | ID ID Usage |
app_1 | |=============================================================================|
app_1 | +-----------------------------------------------------------------------------+
app_1 | cudf version: 23.02.00a+303.g55ef6018ed
app_1 | cuspatial version: 0+untagged.1754.gca41f36
app_1 | QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jovyan'
(all_cuda-118_arch-x86_64) jovyan@epinux:~/cuspatial/python/cuspatial/cuspatial/tests$ export CUSPATIAL_HOME=/home/jovyan/cuspatial/
(all_cuda-118_arch-x86_64) jovyan@epinux:~/cuspatial/python/cuspatial/cuspatial/tests$ pytest
====================================================================================================== test session starts =======================================================================================================
platform linux -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/jovyan/cuspatial/python/cuspatial
plugins: xdist-3.1.0, cov-4.0.0
collected 439 items
test_align.py ....... [ 1%]
test_cudf_integration.py .... [ 2%]
test_from_geopandas.py ........... [ 5%]
test_geocolumn_accessor.py ................................ [ 12%]
test_geodataframe.py .............................................sss.........sss.........sss.........sss... [ 32%]
test_geoseries.py ..............................................sss.........sss... [ 46%]
test_interpolate.py ........... [ 49%]
test_none.py ..... [ 50%]
test_point_linestring_distance.py ......................... [ 56%]
test_shapefile_reader.py ...... [ 57%]
test_trajectory.py ...................... [ 62%]
binpreds/test_contains_properly.py ........................................... [ 72%]
binpreds/test_pip_only_binpreds.py ................ [ 75%]
spatial/bounding/test_linestring_bounding_boxes.py ...... [ 77%]
spatial/bounding/test_polygon_bounding_boxes.py ...... [ 78%]
spatial/distance/test_hausdorff_distance.py ........ [ 80%]
spatial/distance/test_haversine_distance.py ...... [ 81%]
spatial/distance/test_pairwise_linestring_distance.py ....... [ 83%]
spatial/distance/test_pairwise_point_distance.py ....... [ 84%]
spatial/filtering/test_points_in_spatial_window.py ......... [ 87%]
spatial/indexing/test_indexing.py ....... [ 88%]
spatial/join/test_point_in_polygon.py ................... [ 92%]
spatial/join/test_spatial_join.py .......... [ 95%]
spatial/nearest_points/test_nearest_points.py ........ [ 97%]
spatial/projection/test_sinusoidal_projection.py ............. [100%]
======================================================================================================== warnings summary ========================================================================================================
test_geoseries.py:29
/home/jovyan/cuspatial/python/cuspatial/cuspatial/tests/test_geoseries.py:29: PytestCollectionWarning: cannot collect test class 'Test_Feature_Enum' because it has a __new__ constructor (from: cuspatial/tests/test_geoseries.py)
class Test_Feature_Enum(Enum):
cuspatial/tests/test_geodataframe.py: 36 warnings
/home/jovyan/cuspatial/python/cuspatial/cuspatial/tests/test_geodataframe.py:437: FutureWarning: In a future version of pandas all arguments of DataFrame.reset_index except for the argument 'level' will be keyword-only.
expected = gpdf.reset_index(level, drop, inplace, col_level, col_fill)
cuspatial/tests/test_geoseries.py: 18 warnings
/home/jovyan/cuspatial/python/cuspatial/cuspatial/tests/test_geoseries.py:615: FutureWarning: In a future version of pandas all arguments of Series.reset_index except for the argument 'level' will be keyword-only.
expected = gps.reset_index(level, drop, name, inplace)
cuspatial/tests/test_geoseries.py::test_reset_index[None-False-False-None]
cuspatial/tests/test_geoseries.py::test_reset_index[None-False-False-0]
cuspatial/tests/test_geoseries.py::test_reset_index[None-False-False-1]
/home/jovyan/cuspatial/python/cuspatial/cuspatial/tests/test_geoseries.py:615: FutureWarning: Explicitly passing `name=None` currently preserves the Series' name or uses a default name of 0. This behaviour is deprecated, and in the future `None` will be used as the name of the resulting DataFrame column.
expected = gps.reset_index(level, drop, name, inplace)
cuspatial/tests/test_interpolate.py: 10 warnings
/opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/cuspatial/core/interpolate.py:158: UserWarning: Fitting a small number of curves on device may suffer from kernel launch overheads.
warnings.warn(
cuspatial/tests/binpreds/test_contains_properly.py::test_two_points_one_polygon
cuspatial/tests/binpreds/test_contains_properly.py::test_one_point_two_polygons
/opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/geopandas/base.py:31: UserWarning: The indices of the two GeoSeries are different.
warn("The indices of the two GeoSeries are different.")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================= 421 passed, 18 skipped, 70 warnings in 17.06s ==========================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment