I have installed cuda 7 toolkit with newest driver, and it passed all the tests, it seems that driver is loaded, but every time when I just put my laptop to sleep, and wake it up from sleep, cuda doesn't work anymore, deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
init 3
orctrl+Fx
plus restarting the display manager has worked consistently for me.sudo systemctl restart display-manager
orsudo service gdm restart
Related Q&A: https://askubuntu.com/questions/1128057/weid-cuda-driver-state-after-forgetting-to-clean-up-resources-before-suspending and https://askubuntu.com/questions/1228423/how-do-i-fix-cuda-breaking-after-suspend/
I'm running 22.04, X11, GNOME V 42.9, nvidia-driver-535, CUDA Toolkit 12.2
– smcnally Mar 08 '24 at 21:11