RFR: 8333245: RISC-V: UseRVV option can't be enabled after JDK-8316859
Robbin Ehn
rehn at openjdk.org
Thu May 30 13:53:05 UTC 2024
On Thu, 30 May 2024 09:13:30 GMT, Gui Cao <gcao at openjdk.org> wrote:
> Because some dev boards only support RVV version 0.7, In [JDK-8316859](https://bugs.openjdk.org/browse/JDK-8316859) we masked the use of HWCAP to probe for RVV extensions, and in the meantime, we can use hwprobe to probe for V extensions in Linux kernel 6.5 and above. But recently we got Banana Pi BPI-F3 board (has RVV1.0), but his kernel is 6.1.15, so the V extensions detected by HWCAP are masked. And we get the warning: `RVV is not supported on this CPU` when we enable UseRVV with the command, and we can't enable UseRVV correctly.
>
> Without Patch:
>
> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
> OpenJDK 64-Bit Server VM warning: RVV is not supported on this CPU
> bool UseRVV = false {ARCH product} {command line}
> bool UseRVVForBigIntegerShiftIntrinsics = false {ARCH product} {default}
> openjdk version "23-internal" 2024-09-17
> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
>
>
> With Patch:
>
> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
> bool UseRVV = true {ARCH product} {command line}
> bool UseRVVForBigIntegerShiftIntrinsics = true {ARCH product} {default}
> openjdk version "23-internal" 2024-09-17
> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
Another suggestion, it seem like you can ge the triplet mvendorid/marchid/mimpid from /proc/cpuinfo.
So if we can grab those from VM_Version::os_uarch_additional_features() when available and no hwprobe.
We can set those 3, and in VM_Version::vendor_features() check if this is BananPie.
With big warning that kernel do not support vector let user run with vector ?
So that way THEAD is unaffected.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19472#issuecomment-2139602741
More information about the hotspot-dev
mailing list