Skip to content

Andreal2000/Project-Ray-Tracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: Ray Tracing

This project was developed as part of the "GPU Computing" course for the Master's degree in Computer Science at the University of Milan (Università degli Studi di Milano). It aims to compare the performance of a naive CPU-based ray tracing algorithm with a highly parallelized version implemented on a GPU using CUDA.

Features

  • CPU Implementation: A straightforward, sequential version of the ray tracing algorithm.
  • GPU Implementation: A highly parallelized version that leverages thousands of GPU threads to accelerate computations.
  • Project Report: For a detailed explanation of the implementation, results, and analysis, please refer to the project report.

Requirements

To run this project, you will need the following:

  • NVIDIA GPU: A compatible NVIDIA GPU is necessary to run the GPU version of the ray tracing algorithm.
  • NVIDIA CUDA Toolkit: Ensure you have the NVIDIA CUDA Toolkit installed, which includes the nvcc compiler required to compile CUDA code. You can download it from the official NVIDIA website.
  • Make: A build automation tool like make is required to use the provided Makefile for building and running the project.

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/Andreal2000/Project-Ray-Tracing.git
  2. Navigate to the project directory:

    cd Project-Ray-Tracing
  3. Build and execute the project using make

Usage

The project provides a Makefile to simplify the build and execution process. Below are the available commands and their descriptions:

  • Build CPU version:
    Compiles the CPU-based implementation of the ray tracing algorithm.

    make cpu
  • Build GPU version:
    Compiles the CUDA-based implementation of the ray tracing algorithm.

    make gpu
  • Run CPU version:
    Compiles and runs the CPU-based version.

    make cpu-run
  • Run GPU version:
    Compiles and runs the CUDA-based version.

    make gpu-run
  • Sanitize GPU version:
    Compiles and runs the GPU version with CUDA compute sanitizer to detect memory leaks and race conditions.

    make gpu-sanitize
  • Clean build artifacts:
    Removes the compiled binaries and other generated files.

    make clean

Showcase

Balls

ballsAA balls

Earth

earthAA earth

Cornell Box

cornell_box

Stanford Bunny

bunny

Spot

spot

Utah Teapot

teapot

Eight Ball

eight_ballAA eight_ball

Crash Bandicoot

crash_bandicootAA crash_bandicoot

King

king

Mario

mario

Obamium

obamiumAA obamium

About

Project for the course of GPU Computing

Resources

License

Stars

Watchers

Forks