DW_CUDA_ERROR: SDK: cannot acquire cuda context : unknown error

After DriveWorks 5.0.5.0 sample build, run an example program.
It returns errors as follow;

Any ideas would be appreciated!


ENV:

  • Graphic card : GeForce GT 640M LE
  • CUDA 9.0 toolkit
  • ubuntu 16.04 (x64)
  • nvidia display driver: nvidia-387

$ sudo ./sample_canbus_interpreter -h
Program Arguments:
–dbc=/usr/local/driveworks/samples/…/data/samples/sensors/can/sample.dbc
–driver=can.virtual
–params=file=/usr/local/driveworks/samples/…/data/samples/sensors/can/canbus_dbc.can

Initialize DriveWorks SDK v0.6.54
Release build with GNU 4.8.5 from v0.6.0-rc5-0-g3f25786
TimeSource: monotonic epoch time offset is 1517528501000000
SDK: Resources mounted from /usr/local/driveworks-0.6/data/resources
Driveworks exception thrown: DW_CUDA_ERROR: SDK: cannot acquire cuda context : unknown error

Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr

Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr

Cannot create sensor can.virtual with file=/usr/local/driveworks/samples/…/data/samples/sensors/can/canbus_dbc.can
Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr

Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast handle, given instance is a nullptr

Dear nvdpx2,

Could you please help to check CUDA version with “nvcc --version” command?
If can’t check CUDA version, please setup CUDA setting. Thanks.

I am experiencing the same problem. “nvcc --version” returns the following:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Sun_Oct_22_03:08:45_CDT_2017
Cuda compilation tools, release 9.0, V9.0.225

Dear all,

One more thing, did you update also Aurix FW? Thanks.

I’m having this problem on the host example - does updating the Aurix FW impact running examples on the host? I’ve updated to DW 5.0.5.0 and flashed the PX2. Also, I’ve verified via the “file” command that the host examples are compiled for x86.

Dear aanand,

I would like to check did you build DriveWorks samples on HOST or not.
If not, please build DW samples file with the following process.

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release /usr/local/driveworks-0.6/samples/
$ make -j

And then please re-try the application.

After build DW samples, if still doesn’t work the app, maybe I think you need to upgrade your graphic card. Thanks.

I tried that and it still doesn’t work. What graphics card is required?

Hi,

I have the same issue. I successfully built the DW samples on host machine and tried to run the samples but the error “cannot acquire cuda context” popped up and cannot init the sdk. My graphic card is GeForce GTX 1050 Ti/PCIe/SSE2. Could you please help me on it.

Dear aanand,
Can you check if you are able to run any CUDA sample(/usr/local/cuda-9.0/samples/1_Utilities/deviceQuery).
Please check if the issue is related to graphics driver.

This fixed the issue:
echo PATH=/usr/local/cuda-9.0/bin:/usr/local/cuda-9.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin > /etc/environment
echo LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib:/usr/local/cuda-9.0/lib64:/usr/lib:/usr/local/cuda/targets/aarch64-linux/lib:/usr/local/cuda-9.0/lib:/usr/local/cuda-9.0/lib64:/usr/lib:/usr/local/cuda/targets/aarch64-linux/lib: >> /etc/environment

Hello,

I tried this fix but for me it doesn’t work.
I want to start the sample_object_detector in the ne DriveWork SDK.
When I start it shows the following:

Platform: Detected Generic x86 Platform
Initialize DriveWorks SDK v1.5.3584
Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g38b3a75
TimeSource: monotonic epoch time offset is 1550192108463707

Driveworks exception thrown: DW_CUDA_ERROR: Platform: cannot acquire cuda context : unkown error

terminate called after throwing an instance of 'std::runtime_error'
 what(): [] DW Error DW_CUDA_ERROR executing DW function: 
 dwInitialize(&m_sdk, DW_VERSION, &SDKParams)
 at /dvs/git/dirty/gitlab-master_av/dw/sdk/samples/dnn/sample_object_detector/main.cpp:135
Aborted (core dumped)

Dear HV_ZF,

SDK v1.5.3584, then you may run Driveworks 1.5.
This version needs CUDA 10.0, I think.

Would you try that again with newer NVIDIA driver(410.93 is available at NVIDIA site)
[url]https://www.nvidia.com/Download/driverResults.aspx/141700/en-us[/url]

Thanks,

Dear ddpx2,

Thank you for your fast Reply!
I have installed the Driver Version 410.78 on my Computer and CUDA 10.0 is installed, too.
Could it then be a different Problem?
(it is not possible or nearly impossible to update the installed Driver because you Need root Access for this, which I do not have…)

Dear HV_ZF,

If you have Drive PX2 AutoChauffeur, DriveWorks 1.2(CUDA 9.2) is required.
(https://docs.nvidia.com/drive/active/5.0.10.3L/pdfs/NVIDIA_DriveWorks_SDK_Release_Notes_1.2.400.pdf)

In my case, I used NVIDIA Driver version 390.87 for GFX 1060.
For Drive AGX Xavier Dev. kit, I have to install CUDA 10 (410.48)

Unfortunately, I am not able to test Drive PX2 AutoChauffeur on CUDA 10 now.

Thanks,