BrownBiomechanics / SlicerAutoscoperM

This 3D Slicer extension enables users to perform image registration.
https://autoscoperm.slicer.org
MIT License
0 stars 3 forks source link

OpenCL OpenGL Error -1000 #57

Closed NicerNewerCar closed 9 months ago

NicerNewerCar commented 9 months ago

In #56 I saw that @jdholt04 was getting a -1000 Unknown error during the creation of the OpenCL-OpenGL context.

According to this site (and confirmed by the OpenCL 1.0 specs) -1000 corresponds to a CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR.

However, I was unable to find a reference to CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR in the OpenCL 1.2 spec, this is the minimum version required by Autoscoper.

Could you provide hardware and driver specs for your machine?

Ideally:

Other Resources

https://stackoverflow.com/questions/42709957/determining-the-exact-cause-of-cl-invalid-gl-sharegroup-reference-khr

jdholt04 commented 9 months ago

Here are the hardware and driver specs:

GPU: Intel UHD Graphics 770, Driver Version: 30.0.101.1002

GPU: NVIDIA GeForce RTX 3070, Driver Version: 31.0.15.1694

CPU: 12th Gen Intel Core i9-12900K

NicerNewerCar commented 9 months ago

I do see your Nvidia driver is out of date 516.94 vs. the latest from Nvidia 537.42.

If you could update your driver and then try again, hopefully, that would fix it.

If not then maybe OpenCL/OpenGL are being split between the integrated GPU and the dedicated GPU?

jcfr commented 9 months ago

@jdholt04 Could you try setting the __NV_PRIME_RENDER_OFFLOAD and __GLX_VENDOR_LIBRARY_NAME environment variables before starting Slicer ?

For example:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./Slicer

References:

jdholt04 commented 9 months ago

@NicerNewerCar @NicerNewerCar I have updated the Nvidia driver and still received the error, so I set the __NV_PRIME_RENDER_OFFLOAD and __GLX_VENDOR_LIBRARY_NAME environment variables before starting Slicer and still received the error. I was using an older preview release of 3D slicer, so I downloaded the most recent release and still receive the error.

jcfr commented 9 months ago

Can you copy below the output reported in the terminal after:

  1. running the command below
  2. click on "Load Wrist data"

Command:

OCL_ICD_ENABLE_TRACE=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ~/Downloads/Slicer-5.4.0-linux-amd64/Slicer  --python-code "selectModule('AutoscoperM')"

Example of output on system with NVIDIA Quadro M2000M and Intel HD Graphics P530

On my workstation where I also have two video cards, I get the following output:

Output:

Switch to module:  "Welcome"
Switch to module:  "AutoscoperM"
Autoscoper v2.8
Initializing OpenGL...

Graphics Card Vendor: NVIDIA Corporation
Quadro M2000M/PCIe/SSE2
Initializing OpenCL-OpenGL interoperability...
4.6.0 NVIDIA 525.125.06
Graphics Card Vendor: NVIDIA Corporation
Initializing OpenGL...
Quadro M2000M/PCIe/SSE2
4.6.0 NVIDIA 525.125.06
Initializing OpenCL-OpenGL interoperability...
KHR ICD trace at /work/Stable/S-0-E-b/SlicerAutoscoperM-build/Autoscoper-build/OpenCL-ICD-Loader/loader/icd.c:71: attempting to add vendor libnvidia-opencl.so.1...
KHR ICD trace at /work/Stable/S-0-E-b/SlicerAutoscoperM-build/Autoscoper-build/OpenCL-ICD-Loader/loader/icd.c:197: successfully added vendor libnvidia-opencl.so.1 with suffix NV
New Client is Connected...
load trial /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/2023-07-20-Wrist.cfg
Reading MayaCam 2.0 file: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/Calibration/xr_pre_cube_4_cam01_MayaCam.txt
Reading MayaCam 2.0 file: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/Calibration/xr_pre_cube_4_cam02_MayaCam.txt
KHR ICD trace at /work/Stable/S-0-E-b/SlicerAutoscoperM-build/Autoscoper-build/OpenCL-ICD-Loader/loader/icd.c:71: attempting to add vendor libnvidia-opencl.so.1...
KHR ICD trace at /work/Stable/S-0-E-b/SlicerAutoscoperM-build/Autoscoper-build/OpenCL-ICD-Loader/loader/icd.c:197: successfully added vendor libnvidia-opencl.so.1 with suffix NV

Setting up a new trial...
Filename: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/2023-07-20-Wrist.cfg
Volume Name: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/Volumes/mc3_dcm_cropped.tif
Volume Name: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/Volumes/rad_dcm_cropped.tif
Root Path is: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist
Task Name: 2023-07-20-Wrist
Tracking Data Directory: /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/Tracking
Looking for Tracking Data File: 2023-07-20-Wrist_mc3.tra
  Not Found
Looking for Tracking Data File: 2023-07-20-Wrist_rad.tra
  Not Found
Current NCC is: 2.16618
load filter settings for camera 0 : /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/xParameters/control_settings.vie
load filter settings for camera 1 : /home/jcfr/.cache/slicer.org/Slicer/SlicerIO/2023-08-01-Wrist/xParameters/control_settings.vie

Output of sudo lshw -C display
sudo lshw -C display
  *-display                 
       description: VGA compatible controller
       product: GM107GLM [Quadro M2000M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:142 memory:dd000000-ddffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:de000000-de07ffff
  *-display
       description: VGA compatible controller
       product: HD Graphics P530
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 06
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:141 memory:dc000000-dcffffff memory:b0000000-bfffffff ioport:f000(size=64) memory:c0000-dffff
jdholt04 commented 9 months ago

My computer was un plugged and moved for carpet cleaning over the weekend, and I just thought to check to make sure I put the display cables in the correct ports and that seems to have been the issue as I am no longer having any errors. Thank you for taking the time to help, and I apologize for not checking that sooner.

SAM

NicerNewerCar commented 9 months ago

No worries, glad this is working now!