A bug has been reported at https://bugs.mojang.com/browse/MCL-10738, so I’m not sure if this solution will work, but you can give it a try:
1.Create a file with the following content:
#! /bin/sh
DRI_PRIME=1 exec java "$@"
- Save it as something.sh
- Make it executable. There should be an option for this in the file properties.
- In the minecraft launcher settings there will be a path to java. Replace it with the path to something.sh that you created.