Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD TEST Gpu limit #1

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
073745d
Avoid workflow failure when markdown report doesn't exist
nyalldawson Dec 11, 2023
7af4536
Fix return code
nyalldawson Dec 11, 2023
e0466ab
plugins/tests: Port to QgisUnitTests
ptitjano Dec 7, 2023
3707510
fix(Qgs3DMapScene): add const to const member functions
benoitdm-oslandia Dec 8, 2023
51ed473
[processing] Generate XYZ tiles: fix bakcground color warning
agiudiceandrea Dec 7, 2023
0884f5c
Build PyQt6 with c++ 17
troopa81 Dec 6, 2023
1a3ebde
Add QGIS Server tab to QgsVectorTileLayerProperties for configuring s…
manisandro Dec 11, 2023
4c9be35
Merge pull request #55574 from manisandro/master
manisandro Dec 12, 2023
5171e05
Ensure more specialised exceptions are raised in PyQGIS
nyalldawson Dec 11, 2023
212406f
qgsterrainentity: Cosmetic changes
ptitjano Dec 11, 2023
f4c2dee
qgs3dmapscene: Remove unused method terrainPendingJobsCount
ptitjano Dec 11, 2023
3003254
fix(qgs3dmapscene): make terrain layer to be handled like other layers
benoitdm-oslandia Dec 8, 2023
1bea903
Fix(3D): rename Qgs3DMapSceneEntity::SceneState to SceneContext to av…
benoitdm-oslandia Dec 8, 2023
c99c090
(TO REMOVE) : debug
benoitdm-oslandia Dec 8, 2023
382a58d
fix(qgs3dmapscene): refactorize duplicated code into updateScene
benoitdm-oslandia Dec 8, 2023
b93bc94
(TO REMOVE) feat(logger): homogeneize log tools: QgsLogger, QgsMessag…
benoitdm-oslandia Dec 8, 2023
bc56f66
(TO REMOVE) qgstessellator: disable boring message
benoitdm-oslandia Dec 8, 2023
1597472
qgs3dutils: Add a function to estimate available gpu memory
ptitjano Dec 8, 2023
e4ce740
feat(3D): add layer name to qgs3dmapsceneentity to improve log and mi…
benoitdm-oslandia Dec 8, 2023
eba6ee4
qgschunkedentity: Fix some comments
ptitjano Dec 11, 2023
4c5bd45
feat(3dmapescene): Move gpu memory management to chunked entities
benoitdm-oslandia Dec 8, 2023
ab7117b
qgschunkedentity: Handle QgsChunkListEntry deletion
ptitjano Dec 11, 2023
e70c42d
qgschunkedentity: Delete the loader once the active job is finished
ptitjano Dec 11, 2023
cab4dab
qgschunknode: Use the same enum syntax everywhere
ptitjano Dec 11, 2023
f8f9af6
fix: node state / memory access issues
benoitdm-oslandia Dec 8, 2023
ae639a6
fix: improve unloading when frozen
benoitdm-oslandia Dec 8, 2023
ba6d79e
fix: gpu memory settings: add a check box for automatic limit
benoitdm-oslandia Dec 8, 2023
2c00cf8
minor fixes
benoitdm-oslandia Dec 8, 2023
6f2b9a1
fix(qgs3dmapscene): apply clazy fixes about "allocating an unneeded t…
benoitdm-oslandia Dec 14, 2023
3f32f79
fix(qgs3dmapscene): apply clazy fix about "lambda capture layer is no…
benoitdm-oslandia Dec 14, 2023
0535dcb
fix(qgschunkedentity): remove temporary #define
benoitdm-oslandia Dec 14, 2023
98bc8ce
fix(logger): clazy/clang errors
benoitdm-oslandia Dec 14, 2023
6cc61fe
fix(qgs3dmapscene): set default value for gpu limit to 500MB
benoitdm-oslandia Dec 20, 2023
461b090
to squash: qgsterrainentity_p disable useless logs
benoitdm-oslandia Dec 20, 2023
9e6b86d
testqgs3drendering only the segfault test
benoitdm-oslandia Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/write_failure_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- name: 'Unzip artifact'
if: fromJSON(steps.download_artifact.outputs.artifact_id) > 0
run: unzip -j test-results-qt${{ matrix.qt-version }}.zip summary.md pr_number git_commit
run: unzip -j test-results-qt${{ matrix.qt-version }}.zip *.md pr_number git_commit || ( e=$? && if [ $e -ne 11 ]; then exit $e; fi )

- name: 'Post test report markdown summary as comment on PR'
if: fromJSON(steps.download_artifact.outputs.artifact_id) > 0
Expand Down
36 changes: 22 additions & 14 deletions python/3d/auto_generated/qgs3dmapscene.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@




class Qgs3DMapScene : QObject
{
%Docstring(signature="appended")
Expand All @@ -31,7 +30,7 @@ Entity that encapsulates our 3D scene - contains all other entities (such as ter
%End
public:

QgsCameraController *cameraController();
QgsCameraController *cameraController() const;
%Docstring
Returns camera controller
%End
Expand All @@ -49,16 +48,11 @@ Resets camera view to show the extent ``extent`` (top view)
.. versionadded:: 3.26
%End

QVector<QgsPointXY> viewFrustum2DExtent();
QVector<QgsPointXY> viewFrustum2DExtent() const;
%Docstring
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid

.. versionadded:: 3.26
%End

int terrainPendingJobsCount() const;
%Docstring
Returns number of pending jobs of the terrain entity
%End

int totalPendingJobsCount() const;
Expand All @@ -70,6 +64,7 @@ Returns number of pending jobs for all chunked entities

enum SceneState
{
Canceled,
Ready,
Updating,
};
Expand All @@ -79,7 +74,7 @@ Returns number of pending jobs for all chunked entities
Returns the current state of the scene
%End

float worldSpaceError( float epsilon, float distance );
float worldSpaceError( float epsilon, float distance ) const;
%Docstring
Given screen error (in pixels) and distance from camera (in 3D world coordinates), this function
estimates the error in world space. Takes into account camera's field of view and the screen (3D view) size.
Expand All @@ -93,7 +88,7 @@ Exports the scene according to the scene export settings



QgsRectangle sceneExtent();
QgsRectangle sceneExtent() const;
%Docstring
Returns the scene extent in the map's CRS

Expand All @@ -118,6 +113,23 @@ Returns the scene's elevation range
Returns the 3D map settings.

.. versionadded:: 3.30
%End

double usedGpuMemory() const;
%Docstring
Returns the used gpu memory for this 3D scene
%End
double maxAvailableGpuMemory() const;
%Docstring
Returns the max available gpu memory for this 3D scene
%End
QList<QString> frozenLayers() const;
%Docstring
Returns frozen layer name list
%End
void readAvailableGpuMemory();
%Docstring
Reads available gpu memory from settings or gpu card
%End

static QMap< QString, Qgs3DMapScene * > openScenes();
Expand All @@ -136,10 +148,6 @@ Returns a map of 3D map scenes (by name) open in the QGIS application.
void terrainEntityChanged();
%Docstring
Emitted when the current terrain entity is replaced by a new one
%End
void terrainPendingJobsCountChanged();
%Docstring
Emitted when the number of terrain's pending jobs changes
%End

void totalPendingJobsCountChanged();
Expand Down
3 changes: 2 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ GENERATE_SIP_PYTHON_MODULE_CODE(qgis._core core/core.sip "${sip_files_core}" cpp
BUILD_SIP_PYTHON_MODULE(qgis._core core/core.sip ${cpp_files} "" qgis_core)
set(SIP_CORE_CPP_FILES ${cpp_files})

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
# TODO QGIS 4 : remove this hack when we switch completely to Qt 6 which supports only c++17
if( ${QT_VERSION_MAJOR} EQUAL 5 AND ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ) )
# Bad hack to fix compilation with gcc 11 - for some reason it's ignoring
# the c++ standard version set for the target in BUILD_SIP_PYTHON_MODULE!
add_definitions(-std=c++14)
Expand Down
25 changes: 18 additions & 7 deletions python/core/auto_generated/qgslogger.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@




class QgsLogger
{
%Docstring(signature="appended")
Expand All @@ -37,7 +38,9 @@ to this file rather than to stdout.
%End
public:

static void debug( const QString &msg, int debuglevel = 1, const char *file = 0, const char *function = 0, int line = -1 );


static void debug( const QString &msg, int debuglevel = QGS_LOG_LVL_DEBUG, const char *file = 0, const char *function = 0, int line = -1 );
%Docstring
Goes to qDebug.

Expand All @@ -48,13 +51,18 @@ Goes to qDebug.
:param line: place in file where the message comes from
%End

static void debug( const QString &var, int val, int debuglevel = 1, const char *file = 0, const char *function = 0, int line = -1 );
static void debug( const QString &var, int val, int debuglevel = QGS_LOG_LVL_DEBUG, const char *file = 0, const char *function = 0, int line = -1 );
%Docstring
Similar to the previous method, but prints a variable int-value pair
%End



static void info( const QString &msg );
%Docstring
Goes to qInfo.
%End

static void warning( const QString &msg );
%Docstring
Goes to qWarning.
Expand All @@ -70,21 +78,24 @@ Goes to qCritical.
Goes to qFatal.
%End




static int debugLevel();
%Docstring
Reads the environment variable QGIS_DEBUG and converts it to int. If QGIS_DEBUG is not set,
the function returns 1 if QGISDEBUG is defined and 0 if not.
%End

static void logMessageToFile( const QString &message );
%Docstring
Logs the message passed in to the logfile defined in QGIS_LOG_FILE if any.
%End

static QString logFile();
%Docstring
Reads the environment variable QGIS_LOG_FILE. Returns NULL if the variable is not set,
otherwise returns a file name for writing log messages to.
%End

static QString logFormat();
%Docstring
Returns the log format used by qgis.
%End

};
Expand Down
27 changes: 27 additions & 0 deletions python/core/auto_generated/qgsmaplayer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,33 @@ QFlags<QgsMapLayer::ReadFlag> operator|(QgsMapLayer::ReadFlag f1, QFlags<QgsMapL




class QgsDummyLayer : QgsMapLayer
{
%Docstring(signature="appended")

Represents a fake/dummy map layer

.. versionadded:: 3.36
%End

%TypeHeaderCode
#include "qgsmaplayer.h"
%End
public:
QgsDummyLayer( Qgis::LayerType type, const QString &name = QString() );
%Docstring
Default constructor
%End
virtual QgsMapLayer *clone() const;
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext & );
virtual bool readSymbology( const QDomNode &, QString &, QgsReadWriteContext &, StyleCategories );
virtual bool writeSymbology( QDomNode &, QDomDocument &, QString &,
const QgsReadWriteContext &, QgsMapLayer::StyleCategories ) const;

virtual void setTransformContext( const QgsCoordinateTransformContext & );
};

/************************************************************************
* This file has been generated automatically from *
* *
Expand Down
24 changes: 15 additions & 9 deletions python/core/qgsexception.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,57 @@
%End
};

%Exception QgsException(SIP_Exception) /PyName=QgsException/
%Exception QgsProviderConnectionException(SIP_Exception) /PyName=QgsProviderConnectionException/
{
%TypeHeaderCode
#include <qgsexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsException, sipExceptionRef.what().toUtf8().constData() );
PyErr_SetString(sipException_QgsProviderConnectionException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};


%Exception QgsProviderConnectionException(SIP_Exception) /PyName=QgsProviderConnectionException/
%Exception QgsNotSupportedException(SIP_Exception) /PyName=QgsNotSupportedException/
{
%TypeHeaderCode
#include <qgsexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsProviderConnectionException, sipExceptionRef.what().toUtf8().constData() );
PyErr_SetString(sipException_QgsNotSupportedException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};

%Exception QgsNotSupportedException(SIP_Exception) /PyName=QgsNotSupportedException/
%Exception QgsSettingsException(SIP_Exception) /PyName=QgsSettingsException/
{
%TypeHeaderCode
#include <qgsexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsNotSupportedException, sipExceptionRef.what().toUtf8().constData() );
PyErr_SetString(sipException_QgsSettingsException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};

%Exception QgsSettingsException(SIP_Exception) /PyName=QgsSettingsException/
// IMPORTANT -- QgsException MUST be last listed, or it will greedily prevent the more
// specialized exceptions from being raised

%Exception QgsException(SIP_Exception) /PyName=QgsException/
{
%TypeHeaderCode
#include <qgsexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsSettingsException, sipExceptionRef.what().toUtf8().constData() );
PyErr_SetString(sipException_QgsException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};

// IMPORTANT -- QgsException MUST be last listed, or it will greedily prevent the more
// specialized exceptions from being raised

7 changes: 4 additions & 3 deletions python/plugins/grassprovider/tests/AlgorithmsTestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
QgsProcessingFeedback)
from qgis.analysis import (QgsNativeAlgorithms)
from qgis.testing import (_UnexpectedSuccess,
start_app,
unittest)
QgisTestCase,
start_app)

from utilities import unitTestDataPath

import processing
Expand Down Expand Up @@ -391,7 +392,7 @@ def check_results(self, results, context, params, expected):
self.assertRegex(data, rule)


class GenericAlgorithmsTest(unittest.TestCase):
class GenericAlgorithmsTest(QgisTestCase):
"""
General (non-provider specific) algorithm tests
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@

from qgis.core import QgsApplication
from qgis.testing import (
start_app,
unittest
QgisTestCase,
start_app
)
from grassprovider.Grass7AlgorithmProvider import Grass7AlgorithmProvider
from grassprovider.Grass7Utils import Grass7Utils


class TestGrass7AlgorithmsImageryTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
class TestGrass7AlgorithmsImageryTest(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):

@classmethod
def setUpClass(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@

from qgis.core import QgsApplication
from qgis.testing import (
start_app,
unittest
QgisTestCase,
start_app

)
from grassprovider.Grass7AlgorithmProvider import Grass7AlgorithmProvider
from grassprovider.Grass7Utils import Grass7Utils


class TestGrass7AlgorithmsRasterTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
class TestGrass7AlgorithmsRasterTest(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):

@classmethod
def setUpClass(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
QgsProcessingFeedback
)
from qgis.testing import (
start_app,
unittest
QgisTestCase,
start_app
)
from grassprovider.Grass7AlgorithmProvider import Grass7AlgorithmProvider
from grassprovider.Grass7Utils import Grass7Utils
Expand All @@ -42,7 +42,7 @@
testDataPath = os.path.join(os.path.dirname(__file__), 'testdata')


class TestGrass7AlgorithmsRasterTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
class TestGrass7AlgorithmsRasterTest(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):

@classmethod
def setUpClass(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
QgsProcessingFeedback,
QgsProcessingFeatureSourceDefinition)
from qgis.testing import (
start_app,
unittest
QgisTestCase,
start_app
)
from grassprovider.Grass7AlgorithmProvider import Grass7AlgorithmProvider
from grassprovider.Grass7Utils import Grass7Utils
Expand All @@ -47,7 +47,7 @@
testDataPath = os.path.join(os.path.dirname(__file__), 'testdata')


class TestGrass7AlgorithmsVectorTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
class TestGrass7AlgorithmsVectorTest(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):

@classmethod
def setUpClass(cls):
Expand Down
Loading