OpenCL Shared Virtual Memory Comes To Mesa's Rusticl Driver
Mesa 23.1 enables RadeonSI Rusticl support while for next quarter's Mesa 23.2, which just started development, there is already a big ticket item for Rusticl: Shared Virtual Memory (SVM) support.
Shared Virtual Memory that was added in OpenCL 2.0 allows for the host and GPU device to easily share pointers and other pointer-based data structures. SVM's shared virtual address space also lays out requirements around coherent access, synchronization, and other functionality that opens up OpenCL for more use cases.
Rusticl developer Karol Herbst at Red Hat has maintained a Mesa merge request for four months to provide fine-grained system SVM support while that code was merged overnight into the newly-started Mesa 23.2-devel cycle.
Karol noted it's working mostly fine for the Nouveau Gallium3D driver besides hitting driver bugs. SVM support in Rusticl also reduces one less feature that was currently an advantage of the older but unmaintained Gallium3D Clover state tracker.
Karol further explained in the commit enabling SVM for Rusticl:
See this merge request if interested in more details on this thousand lines of new code.
Shared Virtual Memory that was added in OpenCL 2.0 allows for the host and GPU device to easily share pointers and other pointer-based data structures. SVM's shared virtual address space also lays out requirements around coherent access, synchronization, and other functionality that opens up OpenCL for more use cases.
Rusticl developer Karol Herbst at Red Hat has maintained a Mesa merge request for four months to provide fine-grained system SVM support while that code was merged overnight into the newly-started Mesa 23.2-devel cycle.
Karol noted it's working mostly fine for the Nouveau Gallium3D driver besides hitting driver bugs. SVM support in Rusticl also reduces one less feature that was currently an advantage of the older but unmaintained Gallium3D Clover state tracker.
Karol further explained in the commit enabling SVM for Rusticl:
At the moment it's an all or nothing. A driver supporting fine-grained system SVM can enable it in order to get full SVM support.
Lower levels could be emulated by userptrs and placing the bo at the same locations in the GPU's VM as well, but that would require reworking quite a bit on the drivers side.
For now supporting mmu_notifiers on the kernel side is the only way of getting SVM support with Rusticl.
The only driver having the gallium bits wired up atm is Nouveau, but I suspect it shouldn't be all to hard for iris and radeonsi as well.
See this merge request if interested in more details on this thousand lines of new code.
9 Comments