RBVI / ChimeraX

Source code for molecular graphics program UCSF ChimeraX
https://www.rbvi.ucsf.edu/chimerax/
Other
136 stars 24 forks source link

ChimeraX cannot use GPU #37

Closed von-elfen closed 6 months ago

von-elfen commented 6 months ago

Hi,

I recently installed ChimeraX on my ubuntu for cryo-EM modelling. The installation went well, but it ran very sluggish. Through the 'nvitop' command, I found that my graphics card is not working.

Here are some detailed information:

CPU: AMD 7900X GPU: 4060Ti 16G GPU driver: 525.147.05 (nvidia-smi) cuda: 11.8.0 (nvcc -v) cudnn: 8.6.0 (cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2) openGL: 4.5 (glxinfo | grep "OpenGL version") OS: ubuntu 22.04.3 LTS (desktop)

1 Download ChimeraX1.7 for Ubuntu22.04 at https://www.cgl.ucsf.edu/chimerax/download.html 2 'sudo dpkg -i ucsf-chimerax_1.7ubuntu22.04_amd64' 3 'udo apt --fix-broken install'

Then I started ChimeraX from command line: chimerax and it printed:

[22382:7:0101/135824.410783:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

Anyone got the same problems?

tomgoddard commented 6 months ago

The ChimeraX command "graphics driver" will report what graphics driver ChimeraX is using.

https://www.cgl.ucsf.edu/chimerax/docs/user/commands/graphics.html

This will allow you to see if ChimeraX is using the Nvidia driver or Mesa software rendering.

Also I'm a bit puzzled why you didn't follow the ChimeraX installation instructions on the download page which says to install using

sudo apt install ~/Downloads/ucsf-chimerax_1.7ubuntu22.04_amd64.deb

By using dpkg you made it not install needed dependencies. Maybe your "sudo apt --fix-broken install" remedies that. I'm not knowledgable enough about Linux to know.

tomgoddard commented 6 months ago

If you are using X11 remote display, there are very often OpenGL compatibility issues between the local and remote computers that prevent that from working.

von-elfen commented 6 months ago

@tomgoddard

Thank you for your thoughtful response! I have solved the problem!

Here are my old notes for anyone who has the same problem:

For the installation step: Actually, I first followed the instructions to install using apt, but ChimeraX cannot use Nvidia GPU. So I uninstalled it and reinstalled it using 'dpkg'. Installation went the same way.

For X11 display: My OS is Ubuntu22.04.3 Desktop and the windowing system was indeed X11. I was running ChimeraX locally, so I guess there may not be a remotedisplay.

For detailed problem: My previous description may not be that accurate. Sorry about that. After installation I clicked directly on the icon, GUI came out successfully. When a .cxs file (from my laptop) is loaded, subsequent mouse operations are very slow. Obviously there was a graphical problem, but there was no error info. So I tried to start ChimeraX from the command line to get some useful info. As you can see, an ERROR was printed: [22382:7:0101/135824.410783:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

For your advice about the video driver: Thanks for your help. I typed this into the ChimeraX console and it printed out

OpenGL version: 4.5 (core profile) Mesa 23.0.4-0ubuntu1~22.04.1 OpenGL Renderer: llvmpipe (LLVM 15.0.7, 256 bit) OpenGL vendor: Mesa

Yes... It did not detect the Nvidia driver. I do not know how to solve this problem.

Maybe there is a noteworthy information: My 'About' in the 'Settings' of Ubuntu, the graphics shows "llvmpipe (LLVM 15.0.7, 256 bits)" instead of something like Nvidia*. Since the AMD Ryzen 7900X has its own GPU, I have disabled the integrated graphics in the bios. This is pretty weird!


SOLUTION Please check OpenGL with glxinfo |grep OpenGL

The key is "llvmpipe (LLVM 15.0.7, 256 bits)". OpenGL did not detect a nvidia GPU!

So, reinstall the GPU driver(remember close X display and nouveau) sudo ./NVIDIA-Linux-*.run No for 32-bit compatibility Yes for X configuration after installation,run modprobe nvidia

Last, I ran ChimeraX and ran "graphic driver". It became

"OpenGL version: 3.3.0 NVIDIA 525.147.05 OpenGL renderer: NVIDIA GeForce RTX 4060 Ti/PCIe/SSE2 OpenGL vendor: NVIDIA Corporation"

In Setting->About->Graphic, it became:

NVIDIA Corporation

Everything goes well!

If you still have problems, you can check these: 1 2 3 4 5

tomgoddard commented 6 months ago

Glad to hear that reinstalling the Nvidia graphics driver fixed the problem.