"NO GPU DETECTED" error when attempting sl.Camera().open()

Hello!
I’m using a code for decompressing an .svo file using the NEURAL model mode from inside a docker container based on the 4.0-runtime-cuda12.1-ubuntu22.04 image. I’ve executed the code succesfully in a computer with NVIDIA 4070 RTX.

Now I need to run the code in another PC with NVIDIA 3060 RTX. I’ve already transfered the image and runned a container using the same docker command, but when the code gets to:

#(...)Previous sl.InitParameters config
self.cam = sl.Camera()
self.status = self.cam.open(self.init)
if self.status != sl.ERROR_CODE.SUCCESS:
            print(repr(self.status))
            exit()

I get the next error:

NO GPU DETECTED
CUDA error at Camera.cpp:163 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:195 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:226 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:266 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:271 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:290 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 

Now consider a second docker container which haves CUDA 11.4 from where I can run the code without getting any errors. The problem is that this container has another version of the ZED SDK and therefore the neural model version is 1.3, which to my project criteria has way less performance than the newer 2.0 version available in the image that I want to use in this PC.

The output of the 4.0-runtime-cuda12.1-ubuntu22.04 container when executing nvidia-smi is the next:

root@fd55cd44de3f:/home/mass_estimation# nvidia-smi
Wed Feb 28 19:10:33 2024       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.147.05   Driver Version: 525.147.05   CUDA Version: 12.1     |
|-------------------------------+----------------------+----------------------+
| 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  On |                  N/A |
|  0%   50C    P8    15W / 170W |    597MiB / 12288MiB |      6%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

How can I fix the NO GPU DETECTED error?

Hi @NVG97
what command are you using to launch the container? Did you add all the required flags to enable the GPU processing?

Hi @Myzhar,
To run both docker containers I’m executing a bash file with the next ‘docker run …’ commands:

    	echo "Starting SVOHandlerContainer"        
        # Sart a new container with enabled X-11 server        
        docker run --gpus all --detach -it\
            --name SVOHandlerContainer \
            -e DISPLAY=$DISPLAY \
            -e PYTHONPATH=/home/mass_estimation/experiments/:/home/mass_estimation/experiments/mmdetection:/home/mass_estimation/ \
            -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH -v ${PWD}:/home/mass_estimation \
            -v "$INPUT_PATH:/home/mass_estimation/pending_videos" -v "$OUTPUT_PATH:/home/mass_estimation/pending_videos_output" -v "$BLENDER_DATA:/home/mass_estimation/blender_dataset" \
            -v "/usr/local/zed/resources:/usr/local/zed/resources"\
            --network="docker_bridge"\
            -p 8000:8000\
            -e TZ=$(cat /etc/timezone) \
            stereolabs/zed:4.0-cuda12.1-SVOHandler\
            sh -c "python3 /home/mass_estimation/InterDocker_communication/HTTP_listener.py"
       
       echo "Starting BiomassContainer"
       docker run --gpus all -it \
            --name BiomassContainer \
            -e DISPLAY=$DISPLAY \
            -e PYTHONPATH=/home/mass_estimation/experiments/:/home/mass_estimation/experiments/mmdetection:/home/mass_estimation/ \
            -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH -v ${PWD}:/home/mass_estimation \
            -v "$INPUT_PATH:/home/mass_estimation/pending_videos" -v "$OUTPUT_PATH:/home/mass_estimation/pending_videos_output" -v "$BLENDER_DATA:/home/mass_estimation/blender_dataset" \
            --privileged \
            --network="docker_bridge" \
            -e TZ=$(cat /etc/timezone) \
            mass-estimation:${VERSION} 2>&1

####CONTEXT####
The project relies on the BiomassContainer, which crashes when using the neural depth mode for an incompatibility between the NVIDIA 4070 RTX and the CUDA 11.4/ZED SDK of the image.

For a series of reasons I haven’t been able to update the project with the newest zed image without compromising the rest of functionalities, so the solution was to create a second docker container, SVOHandlerContainer, which is exclusively used for the decompression of the zed camera .svo videos and has the latest available version 4.0-runtime-cuda12.1-ubuntu22.04.
#################

I used this bash file to execute both docker containers in the PC with the NVIDIA 4070 RTX and the SVOHandlerContainer worked without problems.

Upon changing to the NVIDIA 3060 RTX PC I encountered the NO GPU DETECTED error with the SVOHandlerContainer, whereas not with the BiomassContainer which succesfully extracted the data using the 1.3v of the depth neural model (In this case the GPU is compatible with CUDA 11.4).

Hope I described the problem better. Thanks in advance

Hi @NVG97,

We currently do not have a setup with a RTX 3060, so it is difficult to test on our end.

I notice in the commands you’ve sent that the SVOHandlerContainer is not run with the --privileged flag. Can you use this flag and see if this solves your issue?

In the meantime, can you run the ZED_Diagnostic tool on your PC with the RTX 3060?

Thanks,

Hi @mattrouss,

I changed the bash file to run the SVOHandlerContainer with the –privileged flag but the problem remains.

In the other hand, I cannot run the ZED_Diagnostic tool from the host since the SDK is not installed in the machine (Which has CUDA 10.1). If strictly necessary, I can install a newer version of CUDA to then install and execute the zed diagnostics tool, but since the BiomassContainer works fine I don’t think this will solve the problem.

In the meantime I ran the ZED_Diagnostics tool from the BiomassContainer, which has all ZED tools avaible with the version 3.7.6 of the SDK.

{
    "AI Models": {
        "info": [
            "MULTI CLASS DETECTION is not optimized",
            "MULTI CLASS MEDIUM DETECTION is not optimized",
            "MULTI CLASS ACCURATE DETECTION is not optimized",
            "HUMAN BODY FAST DETECTION is not optimized",
            "HUMAN BODY MEDIUM DETECTION is not optimized",
            "HUMAN BODY ACCURATE DETECTION is not optimized",
            "PERSON HEAD DETECTION is not optimized",
            "REID ASSOCIATION is not optimized",
            "NEURAL DEPTH is not optimized"
        ]
    },
    "Camera Test": {
        "InternalDevicesCount": 0,
        "ZEDCount": 0,
        "error": [
            "<b>Camera not detected</b> <br/> Make sure the camera is plugged in or try another USB 3.0 port."
        ]
    },
    "Graphics Card": {
        "deviceCount": 1,
        "deviceDriverVersion": 12000,
        "devices": [
            {
                "arch": "Ampere",
                "computeCapability": "8.6",
                "cores": 3584,
                "name": "NVIDIA GeForce RTX 3060",
                "totalMemoryBytes": "12620922880",
                "totalMemoryMB": 12036.25
            }
        ],
        "initResult": 0,
        "valid": [
            "<b>Graphics card: </b> NVIDIA GeForce RTX 3060"
        ]
    },
    "Processor": {
        "OS": "Ubuntu 20.04.4 LTS ",
        "avxSupported": true,
        "coreCount": "20",
        "cpu": " Intel(R) Core(TM) i9-10900 CPU @ 2.80GHz",
        "datetime": "2024-03-04 12:01:20",
        "hyperThreading": "1",
        "motherboard": "PRIME H510M-E, ASUSTeK COMPUTER INC.",
        "ramCapacity": "33.492636",
        "ramUsage": "",
        "ramUsed": "13.314834",
        "threadCount": "40",
        "valid": [
            "<b>Processor: </b>  Intel(R) Core(TM) i9-10900 CPU @ 2.80GHz",
            "<b>Motherboard: </b> PRIME H510M-E, ASUSTeK COMPUTER INC."
        ]
    },
    "USB": {
        "CorruptedFirmware": false,
        "USBList": [
            {
                "USB_path": "/4",
                "idProduct": "0x0900",
                "idVendor": "0x0480"
            },
            {
                "USB_path": "/3",
                "idProduct": "0x1666",
                "idVendor": "0x0951"
            },
            {
                "USB_path": "/2",
                "idProduct": "0x0900",
                "idVendor": "0x0480"
            },
            {
                "USB_path": "/1",
                "idProduct": "0x0901",
                "idVendor": "0x0480"
            },
            {
                "USB_path": "/9",
                "idProduct": "0x181b",
                "idVendor": "0x0b05"
            },
            {
                "USB_path": "/14",
                "idProduct": "0x0024",
                "idVendor": "0x03f0"
            }
        ],
        "ZEDDetected": null,
        "notTested": [
            "Please connect a camera to test the USB connection."
        ]
    },
    "ZED SDK": {
        "CUDA loading": false,
        "GPU Driver Version": "Driver Version                            : 525.147.05",
        "GPU Performance": "    Performance State                     : P8",
        "ZED SDK Version (Diag)": "3.7.6",
        "ZED SDK Version (RT)": "3.7.6",
        "[Warning] Other cuda version N°0": "V11.4.152-->located in  in /usr/local/cuda-11.4/bin/nvcc",
        "ai": {
            "checkAI": true,
            "cudaVersion": 11040,
            "cudnnCudartVersion": 11060,
            "cudnnVersion": 8401,
            "cudnnVersionExpected": 8401,
            "tensorVersion": 8400
        },
        "binFiles": [
            "libsl_ai.so",
            "libsl_zed.so",
            "libsl_zed_static.a"
        ],
        "error": [
            "<b>CUDA 11.7 not detected</b> <br/> Make sure CUDA is installed and restart your computer. <a href='https://download.stereolabs.com/cuda11_7_web' style='color: #19b5ec;' >Download</a>."
        ],
        "resourcesFiles": [
            "neural_depth_1.3.model"
        ],
        "resourcesFilesExpected": [
            "objects_performance_2.2"
        ],
        "valid": [
            "<b>ZED SDK version:</b> 3.7.6"
        ]
    }
}

I cannot do this from the SVOHandlerContainer since it doesn’t have the SDK tools.

Hi @NVG97,

I apologize for the delay, we have not been able to reproduce the issue on our end.

Can you try to run a docker container using the base image 4.0-runtime-cuda12.1-ubuntu22.04 with the same docker run command that you have been using, run any sample from the ZED SDK, and set the InitParameters.sdk_verbose = true ?

This will provide more info on the error at hand.

Hi @mattrouss,

I ran the 4.0-runtime-cuda12.1-ubuntu22.04 base image with the same docker run command that I showed on one of my previous responses. Then I executed the following commands:

pip install requests
python3 /usr/local/zed/get_python_api.py

To test the container I downloaded the hello_zed.py sample code and changed the sdk_verbose to 1 (setting it to ‘True’ would trigger an error message: (expected int, got bool)):

import pyzed.sl as sl


def main():
    # Create a Camera object
    zed = sl.Camera()

    # Create a InitParameters object and set configuration parameters
    init_params = sl.InitParameters()
    init_params.sdk_verbose = 1

    # Open the camera
    err = zed.open(init_params)
    if err != sl.ERROR_CODE.SUCCESS:
        exit(1)

    # Get camera information (ZED serial number)
    zed_serial = zed.get_camera_information().serial_number
    print("Hello! This is my serial number: {0}".format(zed_serial))

    # Close the camera
    zed.close()

if __name__ == "__main__":
    main()

Executing the program gets the next output with exit(1):

[2024-03-11 14:56:12 UTC][ZED][INFO] Logging level INFO
[ZED][INFO] Using USB input... Switched to default resolution HD720
No NVIDIA graphics card detected. Install an NVIDIA GPU, CUDA and restart your computer after completing installation.
[2024-03-11 14:56:13 UTC][ZED][WARNING] NO GPU DETECTED in sl::ERROR_CODE sl::Camera::open(sl::InitParameters)

May I add that using my code for the svo extraction got the next outputs, first with the working container and then with the current not functional container (both started with the same commands):
BiomassContainer - version 3.7.6 of the SDK

[ZED][INFO] Logging level INFO
[ZED][INFO] [Init]  Depth mode: NEURAL
[ZED][INFO] Please wait while the AI model is being optimized for your graphics card
 This operation will be run only once and may take a few minutes
 Optimizing neural_depth_1.3 |  100.0%[=============================>] Done ! in 4min 25s 

4.0-runtime-cuda12.1-ubuntu22.04 base image:

[2024-03-11 15:02:39 UTC][ZED][INFO] Logging level INFO
No NVIDIA graphics card detected. Install an NVIDIA GPU, CUDA and restart your computer after completing installation.
[2024-03-11 15:02:39 UTC][ZED][WARNING] NO GPU DETECTED in sl::ERROR_CODE sl::Camera::open(sl::InitParameters)
NO GPU DETECTED
CUDA error at Camera.cpp:163 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:195 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:226 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:266 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:271 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
CUDA error at Camera.cpp:290 code=804(cudaErrorCompatNotSupportedOnDevice) "void sl::Camera::close()" 
[2024-03-11 15:02:39 UTC][ZED][ERROR] [ZED] sl::Camera::Open has not been called, no Camera instance running.
[2024-03-11 15:02:39 UTC][ZED][ERROR] [ZED] sl::Camera::Open has not been called, no Camera instance running.

Hope this provides a little more insight and thanks for the replies!

Thank you for the additional information.

This actually looks like a CUDA issue, suggesting that your GPU is not supported by CUDA 12.1.
Can you perform the same test with CUDA 11.8, specifically with this image: 4.0-runtime-cuda11.8-ubuntu22.04 ?