goedev commited on
Commit
901eeb8
·
1 Parent(s): bc73aa3

more information about GPU.

Browse files
Files changed (1) hide show
  1. app.py +22 -6
app.py CHANGED
@@ -10,6 +10,7 @@ from rayt.scene import random_scene
10
  from rayt.cuda_renderer import render_with_cuda
11
  from rayt.numba_renderer import render_with_numba
12
  from rayt.rust_renderer import render_with_rust
 
13
  import gradio as gr
14
 
15
  IS_CUDA_AVAILABE, _ = is_cuda_available()
@@ -76,16 +77,31 @@ with gr.Blocks() as iface:
76
  )
77
 
78
  if IS_CUDA_AVAILABE:
79
- gr.Markdown(
80
- "CUDA support: **<span style='color: green'>AVAILABLE</span>**. Rendering will be done on the GPU."
 
 
 
 
 
 
81
  )
82
  else:
83
- gr.Markdown(
84
- "CUDA support: **<span style='color: red'>NOT AVAILABLE</span>**. Rendering will be done on the CPU. "
85
- "If you have an NVIDIA GPU, you can clone the project and run it locally. "
86
- "You can also deploy it to a server with CUDA support for faster rendering."
 
 
87
  )
88
 
 
 
 
 
 
 
 
89
  gr.Markdown("## PERFORMANCE")
90
  gr.Markdown("RAYT tested on this machine:")
91
  gr.Markdown(
 
10
  from rayt.cuda_renderer import render_with_cuda
11
  from rayt.numba_renderer import render_with_numba
12
  from rayt.rust_renderer import render_with_rust
13
+ from numba import cuda
14
  import gradio as gr
15
 
16
  IS_CUDA_AVAILABE, _ = is_cuda_available()
 
77
  )
78
 
79
  if IS_CUDA_AVAILABE:
80
+ device = cuda.get_current_device()
81
+ cc = device.compute_capability
82
+ cuda_info_dataframe = pd.DataFrame(
83
+ {
84
+ "CUDA support": ["AVAILABLE"],
85
+ "Found GPU": [device.name.decode('utf-8')],
86
+ "Compute Capability": [f"{cc[0]}.{cc[1]}"]
87
+ }
88
  )
89
  else:
90
+ cuda_info_dataframe = pd.DataFrame(
91
+ {
92
+ "CUDA support": ["NOT AVAILABLE"],
93
+ "Found GPU": ["-"],
94
+ "Compute Capability": ["-"]
95
+ }
96
  )
97
 
98
+ gr.DataFrame(cuda_info_dataframe)
99
+ gr.Markdown(
100
+ "If you have an NVIDIA GPU on your local machine, you can clone the project and "
101
+ "run it locally. You can also deploy it to a server with CUDA support for faster "
102
+ "rendering."
103
+ )
104
+
105
  gr.Markdown("## PERFORMANCE")
106
  gr.Markdown("RAYT tested on this machine:")
107
  gr.Markdown(