Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6951471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:13:26+00:00 2026-05-27T14:13:26+00:00

I am interested in implementing some particle techniques for fluid simulation on GPU’s using

  • 0

I am interested in implementing some particle techniques for fluid simulation on GPU’s using CUDA.

From my experience, the usual way to do visualizations in computational physics on the CPU is to make the program/application output data files (like .vtk files) at every needed time-step and visualize them using a data visualization tool like ParaView or VisIt.

Is there a way to do the visualization directly on the GPU? Do I have to keep sending back per-time-step data files to the CPU, so that after the program exits I can use ParaView/VisIt on them? Wouldn’t there be a performance penalty if so?

If some popular ways of doing GPU based visualization for high-performance computing can be listed here that would be really helpful.

Note: I will be using the graphics cards GTX 570 and Tesla C2050 for most of my work. I am using CUDA 4.0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:13:27+00:00Added an answer on May 27, 2026 at 2:13 pm

    CUDA <-> OpenGL is quite simple.

    You create a OpenGL vertex buffer like this:

    unsigned int _vbo;
    cudaGraphicsResource *_vb_resource;
    
    glGenBuffers(1, &_vbo);
    glBindBuffer(GL_ARRAY_BUFFER, _vbo);
    glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
    

    register it with CUDA:

    cudaGraphicsGLRegisterBuffer(_vb_resource, _vbo, FLAGS);
    

    map it before you call your visualisation kernel:

    vertex_t *ptr = NULL;
    size_t size; 
    cudaGraphicsMapResources(1, &_vb_resource, 0);
    cudaGraphicsResourceGetMappedPointer(ptr, &size, _vb_resource);
    

    call your kernel with the vertex buffer as argument:

    visData<<<BLOCKS, THREADS>>>(data, ptr);
    

    unmap your vertex buffer

    cudaGraphicsUnmapResources(1, &_vb_resource, 0);
    

    and your done. OpenGL can now render your data.

    Also CUDA can interop with DirectX 10 and 11 (even 9 but this is deprecated and depressing)

    Have a look at the samples posted by Martin Beckett. It is not that tricky.

    EDIT: A little hint:
    Disabling vsync may result in better computation performance. vsync is per default enabled. If you have only on thread for rendering and calculations vsync will drop your calculation fps rate to the vsync rate of the used display (60Hz)

    To disable vSync on Windows and Linux use:

        // turn off vsync
    #ifndef _WIN32
        // or just try it for non Windows 
        if (glXGetProcAddress((const GLubyte*) "glXSwapIntervalMESA") != NULL)
            ((void (*)(int))glXGetProcAddress((const GLubyte*) "glXSwapIntervalMESA"))(0);
        else if (glXGetProcAddress((const GLubyte*) "glXSwapIntervalSGI") != NULL)
            ((void (*)(int))glXGetProcAddress((const GLubyte*) "glXSwapIntervalSGI"))(0);
    #else
        wglSwapIntervalEXT(0);
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am interested in implementing particle codes on GPU's using CUDA for some fluid
I'm interested in implementing a Forth system, just so I can get some experience
I'm interested in implementing Backbone.js for some of the more repetitive in-page CRUD structures
I'm interested in implementing PRG in my website for some forms I've created. At
I am interested in implementing a sort of event driven dispatch queue using MPI
Please recommend some material about implementing Object-Oriented Databases for dynamic languages (interested in Ruby).
I'm interested in implementing autocomplete in Python. For example, as the user types in
I'm currently poking around with a new archive format and was interested in implementing
I am interested in moving a number of my projects from Visual Studio and
I'm interested in learning some (ideally) database agnostic ways of selecting the n th

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.