scs-python icon indicating copy to clipboard operation
scs-python copied to clipboard

gpu support from pip install version

Open szrlee opened this issue 6 years ago • 1 comments

When I use pip to install scs and test with solve_random_cone_prob_gpu.py

~/scs-python$ python test/solve_random_cone_prob_gpu.py 
Traceback (most recent call last):
  File "test/solve_random_cone_prob_gpu.py", line 75, in <module>
    main()
  File "test/solve_random_cone_prob_gpu.py", line 14, in main
    solve_feasible()
  File "test/solve_random_cone_prob_gpu.py", line 34, in solve_feasible
    sol_i = scs.solve(data, K, gpu=True, **params)
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/scs/__init__.py", line 56, in solve
    import _scs_gpu

Must I install scs-python from source if I want the GPU feature? Another question, if possible to be answered, is that when I use GPU version pytorch or tensorflow combining with this GPU-version scs, will there be some additional data transferring costs? I suppose not since the data are already loaded to GPU.

Thanks a lot for attention!

szrlee avatar Apr 12 '18 10:04 szrlee

Currently it's not automatically built when installing via pip since not everyone has a GPU and CUDA installed, though we could add it inside a try-except block.

Not sure what you mean with respect to pytorch / TF, but generally speaking SCS will only transfer the main data matrix to the GPU once at the very start of the run.

bodono avatar Apr 16 '18 15:04 bodono