Change CUDA check (#1833)
* Move into check-device
* Use proper solutiona nd write test
* Move test
* Avoid circular import
* Remove patchenv alltogether
* New version
* Better way, run a verification test
* Final working version
* Debug mode
* doc
* Just debug
* Doc
* print