https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97030
Bug ID: 97030 Summary: [nvptx] Need strategy for nvidia JIT bug workarounds Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- ATM, we have the following in the nvptx.c source code: ... #define WORKAROUND_PTXJIT_BUG 1 #define WORKAROUND_PTXJIT_BUG_2 1 #define WORKAROUND_PTXJIT_BUG_3 1 ... Having the workaround hardcoded in the sources has the benefit that when people report a problem with a certain gcc version, you can reasonably assume that you know which workarounds were applied. OTOH, it might unnecessarily slow down real apps on JIT versions that are fixed. So, it could be good to have these runtime switchable. A possible scheme could be: - -mworkaround-<descriptive-name1> - -mworkaround-<descriptive-name2> - -mworkaround-<descriptive-name3> Then, the question is what should the defaults settings be. Perhaps a good strategy is that the workarounds should be on by default, unless there's a fix in the nvidia driver long lived branch. It would also be good to have canary tests in the testsuite, that verify whether the used driver is fixed or not. Then, a patch changing the default from on to off should report the driver version and card used to make the canary fail, and the driver version used to make it pass on that same card. Ideally we'd automate the testsuite to use the workaround if the canary test fails.