Failing catkin_make for zed_ros_wrapper inside Docker container (failure to find Cuda version)

I have a Docker container with ROS setup. Cuda 11 is installed, although there was a previous cuda-10 installation. I can verify cuda-11 version through the following:

  1. nvidia-smi
# nvidia-smi
Mon Oct 25 20:05:37 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8     3W /  N/A |    485MiB /  7982MiB |      7%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+
  1. nvcc --version
# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_Sep_13_19:13:29_PDT_2021
Cuda compilation tools, release 11.5, V11.5.50
Build cuda_11.5.r11.5/compiler.30411180_0
root@remap-msi:~/workspace/ros# 
  1. version.json
# cat /usr/local/cuda/version.json | head -5
{
   "cuda" : {
      "name" : "CUDA SDK",
      "version" : "11.5.0"
   },

although there’s cuda-10 folder under /usr/local:

# ls -Al /usr/local     
total 48
lrwxrwxrwx  1 root root   20 Oct 25 19:18 cuda -> /usr/local/cuda-11.5
drwxr-xr-x  1 root root 4096 Oct 31  2019 cuda-10.0
drwxr-xr-x 16 root root 4096 Oct 25 17:34 cuda-11.5
...

when trying to copmile zed-ros-wrapper, it fails with error:

# catkin_make -DCMAKE_BUILD_TYPE=Release
...
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find CUDA: Found unsuitable version "10.0", but required is at
  least "11" (found /usr/local/cuda)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindCUDA.cmake:1080 (find_package_handle_standard_args)
  /usr/local/zed/zed-config.cmake:72 (find_package)
  zed-ros-wrapper/zed_nodelets/CMakeLists.txt:22 (find_package)


-- Configuring incomplete, errors occurred!
See also "/root/workspace/ros/build/CMakeFiles/CMakeOutput.log".
See also "/root/workspace/ros/build/CMakeFiles/CMakeError.log".
Makefile:5388: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

I’m wondering, why cmake fails to detect cuda-11 and instead finds cuda-10? From my reading of FindCUDA.cmake, it uses nvccc to derive cuda version, which should work in my case. However it fails…

Did you find a solution to this issue?