Magma v2.7.1 adds support for cuda 12 - https://bitbucket.org/icl/magma/src/965af99469cf9b5fdd584b38a4d2911d21cb026c/ReleaseNotes#lines-29. So I think we need to update to magma 2.7.1 for cuda 12.