Failed again with CUDA…

Another sad experience with cuda.

  1. Tensorflow compiling with cuda just doesn’t work when I suspend my machine. (Error: GPU cannot be found.)
    1. Tried to reinstall tensorflow again…FAILED!
    2. Tried to restart the PC…WORKED!
  2. However, I met this error again:
    1. Tried to change:
      1. /home/xiaoxu/Documents/tf_install/venv/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_device_functions.h
        1. line 32:
          1. -#”cuda/include/cuda.h”
          2. +#include “cuda.h”
      2.  /home/xiaoxu/Documents/tf_install/venv/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h
        1. line 24:
          1. -#”cuda/include/cuda_fp16.h”
          2. +#include “cuda_fp16.h”
  3. Then, I recompiled cuda functions, and got all-zero outputs.
    1. I forgot to switch cuda9.0(default) to cuda 10.0, switch to cuda 10.0…WORKED!



  • Due Wed: Meet Varshney
    • GrayScale Rendering
      • I searched: single channel textures, grayscale framebuffer.
      • Solution: Dropbox\OPENGL\TrySomething\Sponza\grayScaleRendering
      • Compare GL_RGB & GL_RED
      •                          Memory             Time
      • GL_RGB        386MB               24ms
      • GL_RED        350MB               24ms
      • Cannot do better if reduce color
      • One question: How to render to frame in one channel?
    • Strange meshes
  • Due Wed: Watch video of CMSC726 (Should do this evening)
  • Due Fri: HW2 CMSC726 (should finish it on Wed)
  • Dur Sep.21: CMSC740 HW3, should finish during weekend
  • Should summarize CMSC740 contents this weekend


  • Bug for log polar transformation for meshes:
    • 1. Is it caused by input quads?
      • I guess no. As said, those types (quads) are all tessellated by the driver to triangles before being passed to the geometry shader. Each quad would be split into two triangles and these would be processed separately by the geometry shader.



  • Fixed depth error. Should initialize depth buffer after obj load
  • Fixed drawing triangles for the cut line:
    • I wrongly set the “layout (triangle_strip, max_vertices = 3) out”, if max_vertices = 3, only one triangle will be outputted!
  • Should use vertex, tess, geom, frag shaders together now! Let recall the whole pipeline…
  • (09/08 added) I met an error for tessellation:
  • Use tessellation CTRL shader to determine the level of tessellation:
    • how to determine the level dynamically? Can do this
    • Ensure that the shared edge(s) between the patches use the same level of tessellation
  • Use tessellation eval shader to calculate the area of the triangle.
  • ——————————————————————————————————————————
  • How to dynamically solve the problem of tessellation?
  • Central Triangle??





Could load texture correctly when rendering to framebuffer. However, when framebuffer is used, only left down corner of the texture is displayed.


I loaded a model with some texture initialization before initiating framebuffer. And the model affected the initialization of framebuffer;

Should initialize framebuffer before loading the model.

Task for tomorrow:

Try every simple mesh in the object separately.


  1. Find large model
    1. Can load Sponza
    2. The loading library is not complete. The .mtl cannot be fully loaded. But the rendering time can achieve >28ms
  2. Color:
    1. Patney: people can easily find difference if color is changed.
  3. Use short in to replace float