cudabrot

所属分类:GPU/显卡
开发工具:Cuda
文件大小:854KB
下载次数:0
上传日期:2022-07-28 20:30:12
上 传 者sh-1993
说明:  用于Buddhabrot分形的CUDA渲染器
(A CUDA renderer for the Buddhabrot fractal)

文件列表:
Makefile (592, 2022-07-29)
cudabrot.cu (28060, 2022-07-29)
examples (0, 2022-07-29)
examples\color_output.jpg (512535, 2022-07-29)
examples\cropped.png (33766, 2022-07-29)
examples\cutoff_10000.png (14130, 2022-07-29)
examples\cutoff_20.png (45742, 2022-07-29)
examples\cutoff_2000.png (19407, 2022-07-29)
examples\gamma_1_0.png (12572, 2022-07-29)
examples\gamma_1_5.png (13051, 2022-07-29)
examples\gamma_2_2.png (13240, 2022-07-29)
examples\hsl_render.jpg (51731, 2022-07-29)
examples\max_100.png (60412, 2022-07-29)
examples\max_1000.png (53209, 2022-07-29)
examples\max_20000.png (38370, 2022-07-29)
generate_hires_color_image.sh (2941, 2022-07-29)
version_timing.txt (2867, 2022-07-29)

CUDAbrot: A "Buddhabrot" Renderer using CUDA or HIP =================================================== About ----- This project contains a small CUDA program for rendering the Buddhabrot fractal using a CUDA-capable GPU. I'm aware that there are at least two other github projects named "cudabrot", but both of them render the Mandelbrot set rather than the Buddhabrot. The Buddhabrot set is a variant of the Mandelbrot set similar to an [attractor](https://en.wikipedia.org/wiki/Attractor), and is generally more processor-intensive to render. Therefore, rendering high-resolution Buddhabrot images is an excellent application of GPU computing. For more information on how the Buddhabrot set is rendered, see the [Wikipedia article](https://en.wikipedia.org/wiki/Buddhabrot) for information about the algorithm and the relationship to the Mandelbrot set. Usage ----- To compile and run this program, you need to be using a Linux system with CUDA installed (the more recent the version, the better), and a CUDA-capable GPU. See below for instructions on AMD, using HIP. Compile the program simply by running `make`. Run it by running `./cudabrot`. A summary of command-line arguments can be obtained by running `./cudabrot --help`. Running the program will produce a single grayscale image. Typically, a colored Buddhabrot image is created by rendering several single- channel images with different parameters, then combining the results by assigning each single-channel image to a color in the output image. Compilation on AMD, using ROCm ------------------------------ This program has also been built and tested using ROCm 3.7 (but older versions probably work) on AMD GPUs. To use this, you'll need to have [installed ROCm](https://github.com/RadeonOpenCompute/ROCm), including `hip`, `rocRAND`, and `hipRAND` (these should be installed by default if you just follow the main ROCm installation instructions). Additionally, you'll need to ensure that `hipcc` and `hipify-perl` are on your `PATH`. The makefile also expects to be able to find `rocRAND` and `hipRAND` under `/opt/rocm/rocrand` and `/opt/rocm/hiprand`, respectively. If you satisfy all of the above requirements, then you should be able to compile the program by running `make hip`. This will produce a `cudabrot` binary that behaves the same way as the CUDA version. (Don't be intimidated by these instructions--check the makefile, it's actually very simple!) Examples and detailed description of options -------------------------------------------- All examples below were rendered using an NVIDIA GTX 970 with 4GB of GPU RAM. - `-d `: Example: `./cudabrot -d 0`. If you have more than one GPU, providing the `-d` flag along with a device number allows you to run computations on a GPU of your choosing. If the `-d` flag isn't specified, the program defaults to using GPU 0. - `-o `: Example: `./cudabrot -o image.pgm`. This program is capable only of saving `.pgm`-format images, which are a simple grayscale bitmap format. Output images always use 16-bit grayscale. If left unspecified, the program will save the image to a file named `output.pgm` by default. - `-w `: Example: `./cudabrot -w 500 -h 500`. This flag controls the horizontal resolution of the output image, in pixels. Note that neither this nor `-h` (for controlling vertical resolution) affects resolution at which the complex plane is actually sampled. Image resolution doesn't directly affect computation speed, but it *will* have an impact on GPU and CPU memory required. For example, rendering a 20000x20000 image (`-w 20000 -h 20000`) takes at least 3 GB of GPU memory, so higher resolutions may only be possible on more-capable GPUs. - `-h `: Example: `./cudabrot -w 500 -h 500`. This is like `-w`, except it controls vertical resolution rather than horizontal resolution. - `-s `: If provided, this must be the name of a file into which the rendering buffer will be saved, for future continuation. If the file already exists when the program starts, it will be loaded (and then updated again before the program exits). This can be helpful if you need to "pause" long-running renders and resume them later. If already present, the file's size must match the expected internal size of the image buffer, but otherwise the file has no specified format. - `--min-real `: Example: `./cudabrot -w 200 -h 100 --min-real 0.0 --max-real 1.0 --min-imag 0.0 --max-imag 0.5`. This, along with `--max-real`, `--min-imag`, and `--max-imag` control the borders of the output-image "canvas" on the complex plane. The rectangle specified must be well-formed (e.g. `--min-real` must be less than `--max-real`, etc.). If you want to set the canvas to something that isn't a square, then you'll also need manually adjust the output width and height to match the aspect ratio. For example, the above "example" command produces this image: ![cropped example image](examples/cropped.png). Note that "zooming in" will *not* necessarily speed up rendering, since points must still be sampled from across the entire Mandelbrot-set domain (from -2.0 to 2.0, and -2.0i to 2.0i). However, these settings can still be used for saving memory if you want to zoom in on finer details without rendering an ultra-high-resolution image. `--min-real` defaults to -2.0. - `--max-real `. See the note about `--min-real`. `--max-real` defaults to 2.0. - `--min-imag `. See the note about `--min-real`. `--min-imag` defaults to -2.0. - `--max-imag `. See the note about `--min-real`. `--max-imag` defaults to 2.0. - `-t

近期下载者

相关文件


收藏者