Skip to content

multiple videocards? upd: with tests #9

Open

Description

@eps696

hi, i've seen some activity over here recent months (glad to face it after ~3 yrs of silence).
does anybody have an idea how to use this lib with multi-card setup?
there's SetAdapter feature in SpoutSDK, would be ultracool to have it operating in python lib too (or to know how to call it, if it's there already)

Activity

  1. eps696 commented on Mar 22, 2020

    @eps696
    Author

    i've managed to add the function calls for adapter control, compiled as explained here https://rusin.work/vjing/tools/spout-for-python, but still didn't make it work end-to-end with multiGPU setup. the lib and Spout don't issue errors anymore, but the final receiver doesn't show anything either.
    here is what i did:

    Spout.cpp:

    #define BOOST_PYTHON_STATIC_LIB
    #include "Spout.h"
    #include <boost/python.hpp>
    
    BOOST_PYTHON_MODULE(SpoutSDK)
    {
    	using namespace boost::python;
    
    	class_<SpoutSender>("SpoutSender")
    		.def("CreateSender", &SpoutSender::CreateSender)
    		.def("GetNumAdapters", &SpoutSender::GetNumAdapters)
    		.def("SetAdapter", &SpoutSender::SetAdapter)
    		.def("GetAdapter", &SpoutSender::GetAdapter)
    		.def("SayHello", &SpoutSender::SayHello)
    		.def("SendTexture", &SpoutSender::SendTexture)
    		.def("ReleaseSender", &SpoutSender::ReleaseSender)
    		;
    	class_<SpoutReceiver>("SpoutReceiver")
    		.def("pyCreateReceiver", &SpoutReceiver::pyCreateReceiver)
    		.def("GetNumAdapters", &SpoutReceiver::GetNumAdapters)
    		.def("SetAdapter", &SpoutReceiver::SetAdapter)
    		.def("GetAdapter", &SpoutReceiver::GetAdapter)
    		.def("pyReceiveTexture", &SpoutReceiver::pyReceiveTexture)
    		.def("ReleaseReceiver", &SpoutReceiver::ReleaseReceiver)
    		.def("SelectSenderPanel", &SpoutReceiver::SelectSenderPanel)
    		.def("GetWidth", &SpoutReceiver::GetWidth)
    		.def("GetHeight", &SpoutReceiver::GetHeight)
    		;
    }
    

    python calls (same for SpoutReceiver):

    adapter_num = 1
    spout_name = 'source'
    width = height = 512
    spoutSender = SpoutSDK.SpoutSender()
    spoutSender.SetAdapter(adapter_num)
    print(' .. Sender on GPU', spoutSender.GetAdapter(), 'of', spoutSender.GetNumAdapters())
    spoutSender.CreateSender(spout_name, width, height, 0) 
    print(' .. Sender created')
    

    further advices are welcome

    here are the compiled libs for all python 3.x versions
    multigpu.zip

  2. changed the title [-]multiple videocards?[/-] [+]multiple videocards? upd: with tests[/+] on Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions