Solved by ptrblck in post #4 
              
              
                If I understand you correctly, setting CUDA_VISIBLE_DEVICES in the terminal works correctly, but doesn’t work if you try to set it inside the script via os.environ. 
This is a commonly met issue, if you are not making sure that the env var is set before importing any CUDA related libraries, which i…