GithubHelp home page GithubHelp logo

emenesesayc / rtx-cuda-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from temporal-hpc/rtx-cuda-template

0.0 0.0 0.0 2.38 MB

Template for starting CUDA+OptiX RTX projects

License: GNU General Public License v3.0

C++ 51.97% C 7.27% Cuda 28.27% CMake 12.49%

rtx-cuda-template's Introduction

RTX-CUDA-template

A simple RTX-CUDA interoperability test program based on the SAXPY example from NVIDIA's RTX Compute Samples https://github.com/NVIDIA/rtx_compute_samples

The sample code simulates n randomly generated numbers, by shifting their value (as if was a 1D coordinate) by a random translation, and computes the minimum value at each time step. The user can choose one of the following approaches for computing such minimum value in GPU:

  • CUDA Kernel
  • CUB
  • Thrust
  • RTX OptiX

Dependencies

  • CUDA 12 or later
  • OptiX 7.7 or later
  • Nvidia driver 530.41 or later
  • CUB (for comparison)
  • THrust (for comparison)

Compile and run

mkdir build && cd build
cmake ../ -DOPTIX_HOME=<PATH-TO-OPTIX-MAIN-DIR> -DThrust_DIR=<PATH-TO-THRUST-CMAKE-CONFIG> -DCUB_DIR=<PATH-TO-CUB-CMAKE-CONFIG>
make
./rtxcuda <dev> <n> <s> <alg>
dev = device ID
n   = problem size
s   = number of simulation steps
alg = algorithm
   1 -> WARP_SHUFFLE
   2 -> CUB
   3 -> THRUST
   4 -> RTX_CLOSEST_HIT

Example compilation

>> cmake ../ -DOPTIX_HOME=~/NVIDIA-OptiX-SDK-7.7.0-linux64-x86_64 -DThrust_DIR=/opt/cuda/targets/x86_64-linux/lib/cmake/thrust -DCUB_DIR=/opt/cuda/targets/x86_64-linux/lib/cmake/cub
>> make

Example execution

./rtxcuda 0 $((2**20)) 1 4

rtx-cuda-template's People

Contributors

crinavar avatar emenesesayc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.