All tests were performed on two hardware configurations. The same software configuration was on both hardware configurations.
Cluster | Intel i7 | Intel i9 |
---|---|---|
Processor | Intel Core i7-7500U (Cores: 2 Threads: 4) | Intel Core i9-11900 (Cores: 8 Threads: 16) |
Graphics Card | NVIDIA GeForce 940MX | None |
Cluster | Intel i7 | Intel i9 |
---|---|---|
Operating System | Ubuntu 18.04 | Ubuntu 18.04 |
C++ Version | C++17 | C++17 |
Compiler | GNU Compiler Collection 9.4.0 | GNU Compiler Collection 9.4.0 |
OpenMp vesrion | 5.1 | 5.1 |
The time complexity measure was used to evaluate the efficiency of the implemented ray tracing algorithm. The time required to execute a single-threaded CPU program is defined as:
-
$I_H$ is the height of the rendered image, -
$I_W$ is the width of the rendered image, -
$g(S,x_i,y_j)$ is a function that defines the computational load depending on the scene$S$ and the specific pixel ($x_j, y_i$ ) of the image.
The relationship describing the time needed to execute a multi-threaded CPU program on
In another test, image rendering using the same ray tracing algorithm using the graphics card was added to the comparison (represented as
The conducted tests lead to the following conclusions:
- Skillful implementation of parallel computing leads to an increase in the efficiency of the algorithm.
- In the context of parallel computing, the CPU cannot compete with the GPU. The results of the much older NVIDIA GeForce 940MX (year of introduction 2016) outperformed the modern Intel i9 processor (year of introduction 2021).
- In the case of the central processing unit, increasing the number of compute units (threads) significantly improves the performance of the algorithms, the critical point is the number of physical threads in the CPU from that point on, there is no visible improvement.
Clone the project:
git clone https://github.com/M-Komorek/Raytracer.git
Go to the project directory and compile code:
cd Raytracer
./compile.sh
Rander image:
./build/Raytracer > image.ppm
To run tests, run the following command:
./compileAndTest.sh
C++17 - https://en.cppreference.com/w/cpp/17
OpenMp - https://www.openmp.org/
Google Test - https://github.com/google/googletest
CMake - https://cmake.org/