How can I enable "Render layers in parallel using many CPU cores" option from QGIS python console?

closed as off-topic by ahmadhanb, PolyGeo Feb 7 at 10:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – ahmadhanb, PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.


Use this:

from PyQt5.QtCore import QSettings, QThread
# parallel rendering
QSettings().setValue("/qgis/parallel_rendering", True)

for use max cores

from qgis.core import QgsApplication
threadcount = QThread.idealThreadCount()

And extra for use OpenCL acceleration

QSettings().setValue("/core/OpenClEnabled", True)

Not the answer you're looking for? Browse other questions tagged or ask your own question.