Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asserting even if CUDA is installed #3

Closed
jayavanth opened this issue Nov 15, 2018 · 14 comments
Closed

Asserting even if CUDA is installed #3

jayavanth opened this issue Nov 15, 2018 · 14 comments

Comments

@jayavanth
Copy link

$ python3 test_shadow_light.py        
python3: /home/jay/redner/scene.cpp:79: Scene::Scene(const Camera&, const std::vector<const Shape*>&, const std::vector<const Material*>&, const std::vector<const Light*>&, bool): Assertion `false' failed.
[1]    9201 abort (core dumped)  python3 test_shadow_light.py

I'm getting this assert for all tests. I have CUDA installed and enabled during CMake.

#ifdef __NVCC__
    ...
#else 
    assert(false)
#endif

Here's the snippet from scene.cpp. I'm guessing nvcc is not being used to compile scene.cpp

@BachiLi
Copy link
Owner

BachiLi commented Nov 15, 2018

Hi,

CMake probably failed to find nvcc in your case. I slightly modified the building process to make it less confusing. Can you try again? If it still doesn't work, can you show me where is your nvcc, and the CUDA-related variables in your CMakeCache.txt? Maybe also show the log of make VERBOSE=1

@jayavanth
Copy link
Author

jayavanth commented Nov 15, 2018

Sweet! It works now but I'm getting a bus error when I run the tests

[1]    6024 bus error (core dumped)  python3 test_shadow_light.py

@jayavanth jayavanth reopened this Nov 15, 2018
@BachiLi
Copy link
Owner

BachiLi commented Nov 15, 2018

Interesting. What is the compute capability of your GPU? Do you know which line the code crashed?

@jayavanth
Copy link
Author

I have a K40 (3.5) and TitanX (5.2) and it's failing on both of them. My guess is it's crashing on the CPU. I'll find out at what line it's crashing

@jayavanth
Copy link
Author

It's crashing on line 64 test_shadow_light.py

img = render(0, *args)

@BachiLi
Copy link
Owner

BachiLi commented Nov 15, 2018

Can you maybe run a debugger on python (e.g. gdb python, run test_shadow_light.py), and find out which line in the C++ that crashes?

@jayavanth
Copy link
Author

Here's the line:

Thread 1 "python3" received signal SIGBUS, Bus error.
Scene::Scene (this=0x22aaa80, camera=..., shapes=std::vector of length 3, capacity 3 = {...}, 
    materials=std::vector of length 2, capacity 2 = {...}, lights=std::vector of length 1, capacity 1 = {...}, use_gpu=<optimized out>)
    at /home/jay/redner/scene.cpp:137
137	            light_areas[light_id] = area_sum;
(gdb) p area_sum
$1 = 0.040000001192092904
(gdb) p light_id
$2 = 0
(gdb) p light_areas
$3 = {use_gpu = true, data = 0x2308941000, count = 1}

@BachiLi
Copy link
Owner

BachiLi commented Nov 15, 2018

I supposed it's because I didn't synchronize the kernel. I pushed some fix. Let me know if it fixes the problem.

@jayavanth
Copy link
Author

The test runs fine on the CPU with your latest push. But I get this on either GPUs

Thread 51 "python3" received signal SIGBUS, Bus error.
[Switching to Thread 0x7fff5affd700 (LWP 17870)]
0x00007fffbe9091f2 in DScene::DScene (this=0x7fff7800b3b0, camera=..., shapes=std::vector of length 3, capacity 3 = {...}, 
    materials=std::vector of length 2, capacity 2 = {...}, lights=std::vector of length 1, capacity 1 = {...}, use_gpu=<optimized out>)
    at /home/jay/redner/scene.cpp:202
202	            this->shapes[shape_id] = *shapes[shape_id]

@BachiLi
Copy link
Owner

BachiLi commented Nov 15, 2018

Probably the same issue. I pushed another fix that adds more synchronizations. Let me know if there's more issues.

@jayavanth
Copy link
Author

All tests are running fine now. Awesome! Thanks!

@mguillau mguillau mentioned this issue Jun 12, 2019
BachiLi pushed a commit that referenced this issue Nov 25, 2019
@Skorkmaz88
Copy link

I started to have this assertion error after using the Redner a while , scene.cpp , line 125, when using calling path tracing functions from Jupyter notebook , but not from .py files so far.

@BachiLi
Copy link
Owner

BachiLi commented Apr 16, 2020

You probably did pip install redner instead of pip install redner-gpu.
Try pip uninstall redner and reinstall the GPU version.

@Skorkmaz88
Copy link

I actually initially installed GPU version and then after awhile had issues, however that is probably an issue happened in my system, oddly py files were running smoothly still, and they were using the same environment. Reinstalling redner-gpu seems to be working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants