Skip to content

Is there a way to bifurcate GPU for simulating multiple? #399

Answered by nvlukasz
cadop asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, the fix has been merged to main and should appear in release 1.5.1.

Here's an example of creating and using some "virtual" devices:

import warp as wp


@wp.kernel
def arange(a: wp.array(dtype=int)):
    tid = wp.tid()
    a[tid] = tid


# ======================================================================
# Create virtual devices
# ======================================================================

NUM_DEVICES = 4
virtual_devices = []

# NOTE: must call wp.init() to initialize wp.context.runtime
wp.init()

for i in range(NUM_DEVICES):
    # create a new CUDA context on cuda:0
    ctx = wp.context.runtime.core.cuda_context_create(0)

    # map as new virtual device
    device = wp.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@nvlukasz
Comment options

Comment options

You must be logged in to vote
1 reply
@cadop
Comment options

Answer selected by nvlukasz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants