Hi,
This environment variable will only have effect when cuda is initialized. If you modify it after cuda is initialized, it will have no effect.
I don’t think you can disable cuda like that. You will need to use a manual flag or a “device” that you give to your test and that will be first cpu then cuda.