CUDA error : the provided PTX was compiled with an unsupported toolchain

Traceback (most recent call last):
File “check.py”, line 32, in
face_encodings = face_recognition.face_encodings(rgb_small_frame, face_locations)
File “/home/shalu/anaconda3/envs/dlib/lib/python3.8/site-packages/face_recognition/api.py”, line 214, in face_encodings
return [np.array(face_encoder.compute_face_descriptor(face_image, raw_landmark_set, num_jitters)) for raw_landmark_set in raw_landmarks]
File “/home/shalu/anaconda3/envs/dlib/lib/python3.8/site-packages/face_recognition/api.py”, line 214, in
return [np.array(face_encoder.compute_face_descriptor(face_image, raw_landmark_set, num_jitters)) for raw_landmark_set in raw_landmarks]
RuntimeError: Error while calling cudaOccupancyMaxPotential

my tried dlib enable CUDA by referring : Installing dlib using conda with CUDA enabled · GitHub

now dlib works but am getting error as shown above.
How to solve it?

Details:
| NVIDIA-SMI 535.171.04 Driver Version: 535.171.04 CUDA Version: 12.2
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

The usual suggestion is to update your GPU driver to the latest available for your GPU.

If I update my GPU driver, will it affect DeepStream? I want to add this code to DeepStream and run it.

DeepStream should work fine with the latest GPU driver.

I tried to upgrade the driver, But it shows that I have the latest version of driver I installed in my system
So what I want to do now?

NVIDIA-SMI 535.171.04 Driver Version: 535.171.04 CUDA Version: 12.2

You have 2 options.

  1. Upgrade your existing GPU driver, choosing a driver installer from here. If you are on a laptop this may be difficult, and you need to take into account how your previous GPU driver was installed. runfile installer vs. package manager. You’ll need to familiarize yourself with the cuda linux install guide and learn the difference between package manager install and runfile install, and possibly remove your old driver first.

or:

  1. Downgrade your CUDA install. Your current driver supports CUDA 12.2:

But you have installed and seem to be using CUDA 12.4:

That is an incompatible combination. If you want to try to install CUDA 12.2 instead, then that may work, and would be compatible with your current GPU driver.

These topics are frequently asked questions, so with a bit of searching your can find other forum articles describing these things.