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

PyCUDA ERROR: The context stack was not empty upon module cleanup #45

Open
JI0726 opened this issue Jun 22, 2022 · 16 comments
Open

PyCUDA ERROR: The context stack was not empty upon module cleanup #45

JI0726 opened this issue Jun 22, 2022 · 16 comments

Comments

@JI0726
Copy link

JI0726 commented Jun 22, 2022

After running ‘bash dev_scripts/w_scannet_etf/scane241_test.sh’ and 'bash dev_scripts/w_n360/chair_test.sh' I got this PyCUDA error:
image
Does anybody know how to solve it?

@zhoupeizhu
Copy link

same problem

@taekkii
Copy link

taekkii commented Jun 30, 2022

I have a same problem, too.

@hdzmtsssw
Copy link

same problem

@zhangchuanyi96
Copy link

similar problem, need help

@Ailon-Island
Copy link

same problem

@phillipinseoul
Copy link

same problem, has anyone found a solution?

@OvOtoQAQ
Copy link

same...

@OvOtoQAQ
Copy link

https://blog.csdn.net/Andrew_megemeta/article/details/115712499
hey guys, I find a blog which seems like be able to solve this problem, I tried a lot but still can't figure out where to pop, if anyone solve this one, please inform me.

@MobiusLqm
Copy link

Same problem!Does anyone know how to fix it??

@yjcaimeow
Copy link

try import pycuda.autoinit

@knightwzh
Copy link

Same problem

@Xharlie
Copy link
Owner

Xharlie commented Nov 26, 2022

hi folks, it is wrong decision to build things in pycuda, and im sorry that i don't have enough time to rebuild everything in a fashion of pure cuda/pytorch.

@juliuskuehn1
Copy link

Hi, I have the same problem. Further I also encountered this when I was running the scripts for:
Test feed forward inference on dtu scenes like 'bash dev_scripts/dtu_test_inf/inftest_scan1.sh'. I was able to fix this by adding model.cleanup() and del model into the train_ft.py before exit() is called.
Unfortunately when trying to apply this to the test_ft.py script, I run into a Segmentation fault instead of the PyCuda ERROR...

@HanLingsgjk
Copy link

Hello, I would like to ask which parts are using pycuda. Perhaps I can rewrite these parts as cuda

@CTouch
Copy link

CTouch commented Dec 12, 2023

#82 (comment)
Try this method.

@lhp121
Copy link

lhp121 commented Nov 28, 2024

我测试代码的时候把下面的代码加在test_ft_.py最后的main函数里面了,import写在这里,不在前面的头文件那,解决了!

if __name__ == '__main__':
    # 清除 CUDA context 栈
    import pycuda.driver as cuda
    import pycuda.autoinit
 
    cuda.Context.pop()
    main()

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