Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5872 closed defect (invalid)

gdalwarp primarily uses CPU & only briefly uses opencl, Nvidia V6.5 Toolkit

Reported by: SteeevO Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.11.2
Severity: normal Keywords: cuda, opencl, gdalwarp,
Cc:

Description

I'm on a new machine with linux mint 17.1 and a K420 Quadro card. I've built gdal from source enabling opencl and pointing the configure options to the header files included in the Nvidia Cuda Toolkit v6.5.

I was able to run and compile the CUDA samples that were included in the toolkit. the samples run fine and activity shows in nvidia-smi

However, when running gdalwarp, the processes is handled only on the CPU and the GPU remains untouched by gdal according to nvidia-smi and the gui system monitor.

using options like -multi -wo USE_ALL_CPUS -wo ENABLE_OPENCL=TRUE all have no effect on time to run the proccess.

Here is the config command I've been using: ./configure --with-png=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-openjpeg=/home/steven/SourceBuilds/openjpeg-2.1.0-Darwin-i386 --with-opencl=yes --with-opencl-include=/usr/local/cuda-6.5/include

Here is the gdalwarp command that I've been using to test:

sudo time gdalwarp -tr 1 1 -t_srs '+proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' -multi -wo NUM_THREADS_ALL_CPUS -wo USE_OPENCL=TRUE -of gtiff -wm 6000 ~/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2 ~/testout.tiff

Change History (11)

comment:1 by Even Rouault, 9 years ago

Priority: highestnormal

This might be a setup issue of OpenCL (you're mentionning Cuda, not OpenCL).

Did ./configure report at the end "OpenCL support: Yes". If not, check/modify your setup.

If it reports OpenCL, you could add "--debug on" to your command line and see if anything interesting shows up.

comment:2 by SteeevO, 9 years ago

yes I mean openCL, I only mention CUDA becuase it's on an nvidia card and the opencl files are from the nvidia cuda toolkit.

Yes, when I configured gdal I got the confirmation of opencl: yes.

At what point do I have the option to use --debug on? as part of ./configure?

in reply to:  2 comment:3 by Even Rouault, 9 years ago

At what point do I have the option to use --debug on? as part of ./configure?

No, when running gdalwarp.

But looking at your command line and at the code, I realize you can't make use of opencl. The opencl code is only used if the resampling alg is not the default nearest neighbour. So you should specify a resampling like average, cubic, etc... to make use of OpenCL.

comment:4 by SteeevO, 9 years ago

Here is the gdalwarp command that I'm using now.

time gdalwarp -tr 1 1 -t_srs '+proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' -r cubic -multi -wo "NUM_THREADS_ALL_CPUS" -wo "USE_OPENCL=TRUE" -of gtiff --debug 1 -wm 6000 ~/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2 ~/testout.tiff

I couldn't find any documentation on the debug option so I just put 1 in there, but it's not outputting anything new. and even with cubic being specified no action is being reported under nvidia-smi.

comment:5 by Even Rouault, 9 years ago

You should use "--debug on", not "--debug 1" (see https://trac.osgeo.org/gdal/wiki/FAQMiscellaneous#HowdoIdebugGDAL and pointed links). Anyway I think this ticket should be closed as it doesn't look like it is a confirmed problem in GDAL itself as folks manage to use the opencl wrapper for sure, but more something on your setup. You'd better post to gdal-dev mailing list.

comment:6 by SteeevO, 9 years ago

I have the opencl sample code from nvidia running now and everything compiled fine. so it's good to know that OpenCL itself is working... but not with gdalwarp..

Here is my latest attempt at this: time gdalwarp -tr 1 1 -t_srs '+proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' -multi -wo NUM_THREADS_ALL_CPUS -wo USE_OPENCL=TRUE -of gtiff -wm 6000 ~/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2 ~/testout.tiff --debug on OGRCT: PROJ >= 4.8.0 features enabled OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. GDALJP2Metadata: Got projection from GeoJP2 (geotiff) box (0): PROJCS["NAD83 / UTM zone 12N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.2572221010002,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4269"]],PROJECTIONTransverse_Mercator,PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26912"]] GDAL: GDALOpen(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x1267bc0) succeeds as JP2OpenJPEG. OGRCT: Source: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Target: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Source: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Target: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Source: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Target: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Source: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Target: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs Creating output file that is 784P x 943L. GDAL: GDALDriver::Create(GTiff,/home/ruggedroutes/testout.tiff,784,943,4,Byte,(nil)) Processing input file /home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2. WARP: Copying metadata from first source to destination dataset Using band 4 of source image as alpha. Using band 4 of destination image as alpha. GDAL: Start chunk 0. OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. Warning 1: Empty SOT marker detected: Psot=12.

OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! GDAL: GDALWarpKernel()::GWKNearestByte() Src=0,0,6301x7585 Dst=0,0,784x943 0...10...20...30...40...50...60...70...80...90...100 - done. GDAL: Finished chunk 0. GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x12684c0) GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x1268be0) GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x1269300) GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x1269a50) GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x126a150) GDAL: GDALClose(/home/ruggedroutes/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0x1267bc0) GTiff: Adjusted bytes to write from 6272 to 3136. GDAL: GDALClose(/home/ruggedroutes/testout.tiff, this=0x1255390)

real 1m49.169s user 1m47.068s sys 0m1.978s

But it's still running on the CPU... And there is no menion of openCL in the debug output.

comment:7 by SteeevO, 9 years ago

any more input on this? After verifying everything relative to my setup, compiling and running the Nvidia openCL examples on the GPU.

I'm convinced that there is something wrong with gdal. I have also verified that gdalwarp and other parts of the gdal package are compiled properly and are properly linked to libOpenCL.so thats included with v6.5 of the nvidia toolkit.

comment:8 by Even Rouault, 9 years ago

Unless I'm wrong, your latest command line doesn't include any resampling option. So the opencl code isn't triggered. And apparently there are people managing to make this code run on nvidia, since we actually fixed something in 1.11.2 (see #5772)

comment:9 by SteeevO, 9 years ago

Summary: gdalwarp won't run on GPU with OpenCL enabled and Nvidia Cuda Toolkit 6.5gdalwarp primarily uses CPU & only briefly uses opencl, Nvidia V6.5 Toolkit

Yes, I've read about that too and have tried with cubic & lanczos resampling many times. However, I did just notice that the proccess pops up in Nvidia-smi towards the end of the process only for about 2 seconds. The rest of the time the CPU has a core that is at 100% and the hard drive is at a near idle (SSD). the source file is about 18MB and running this process with opencl enabled makes less than 0.5 seconds difference.

in the debug output you'll notice that opencl is mentioned right towards the bottom and nowhere else.

Why does the CPU still get 100% utilization and why does opencl only get used for just a couple seconds in a 2 minute process? IT seems that the resampling is probably being done on the CPU and the actual reprojection is being on the GPU? just a guess, but regardless.. this doesn't seem right.

Here is my latest output: $ time gdalwarp -tr 1 1 -t_srs '+proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' -of GTiff -r cubic -wm 6000 -wo "USE_OPENCL=TRUE" ~/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2 ~/testout.tif --debug on OGRCT: PROJ >= 4.8.0 features enabled OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. GDALJP2Metadata: Got projection from GeoJP2 (geotiff) box (0): PROJCS["NAD83 / UTM zone 12N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.2572221010002,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4269"]],PROJECTIONTransverse_Mercator,PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26912"]] GDAL: GDALOpen(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd41bb0) succeeds as JP2OpenJPEG. OGRCT: Source: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Target: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Source: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Target: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Source: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs OGRCT: Target: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Source: +proj=merc +a=635752.3142 +b=634752.3142 +lat_ts=0.0 +Lon_0=0.0 +x=0.00 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs OGRCT: Target: +proj=utm +zone=12 +datum=NAD83 +units=m +no_defs Creating output file that is 784P x 943L. GDAL: GDALDriver::Create(GTiff,/home/user/testout.tif,784,943,4,Byte,(nil)) Processing input file /home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2. WARP: Copying metadata from first source to destination dataset Using band 4 of source image as alpha. Using band 4 of destination image as alpha. OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. Warning 1: Empty SOT marker detected: Psot=12.

OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 0 / 3 has been read. OPENJPEG: info: Tile 0/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 0. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 1 / 3 has been read. OPENJPEG: info: Tile 1/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 1. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 2 / 3 has been read. OPENJPEG: info: Tile 2/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 2. OPENJPEG: info: Stream reached its end ! OPENJPEG: info: Start to read j2k main header (246455). OPENJPEG: info: Main header has been correctly decoded. OPENJPEG: info: Header of tile 3 / 3 has been read. OPENJPEG: info: Tile 3/3 has been decoded. OPENJPEG: info: Image data has been updated with tile 3. OPENJPEG: info: Stream reached its end ! OpenCL: Connected to NVIDIA Corporation Quadro K420. GDAL: GDALWarpKernel()::GWKOpenCLCase() Src=0,0,6301x7585 Dst=0,0,784x943 0...10...20...30...40...50...60...70...80...90...100 - done. GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd42450) GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd42b70) GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd43290) GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd439e0) GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd440e0) GDAL: GDALClose(/home/user/SatImagery/35111/m_3511101_ne_12_1_20100609_20101018.jp2, this=0xd41bb0) GTiff: Adjusted bytes to write from 6272 to 3136. GDAL: GDALClose(/home/user/testout.tif, this=0xd2c4c0)

real 1m49.694s user 1m47.404s sys 0m2.141s

comment:10 by Even Rouault, 9 years ago

Resolution: invalid
Status: newclosed

Ah, so OpenCL is finally used. What you observe is that JPEG2000 decompression is what eats most of the time (and unfortunatelly openjpeg is outperformed by proprietary JPEG2000 decoders). Completely unrelated to warping. From the traces one can see that some tiles are read several times during the warping, so what could improve performance a lot is to increase the size of the gdal block cache with --config GDAL_CACHEMAX 500 (for 500 MB) for example.

I'm going to close that ticket since it mixes several things and is more related to how to optimize/profile things that a particular isolated issue.

comment:11 by SteeevO, 9 years ago

GDAL_CACHEMAX actually helped a ton. however when comparing the results with a cache of 2048 and with and without opencl.. opencl actually takes LONGER to complete the command. nvidia-smi only reports 9MB of GPU memory usage as well.. maybe there is another setting for this somewhere?

I really don't think the opencl implementation is working correctly, being that the CPU still goes to 100% and opencl only briefly kicks in at the end which actually delays the proccess over just running it all on the CPU.

I've also tried with a geotiff file from natural earth with the same findings. I'm willing to read about this more, and I want to get to know the ins and outs of gdal better as well. but it really seems like something still isn't right here...

Note: See TracTickets for help on using tickets.