I suggest you read this first:
https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
An easy way to get all the details you need like CUDA version and compute capabilities (sm
) for your graphics card, is to use this Docker image:
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
# set up build dependencies
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
nvidia-cuda-toolkit \
make \
git
RUN mkdir -p /code && \
git clone --depth 1 https://github.com/NVIDIA/cuda-samples.git /code/cuda-samples && \
cd /code/cuda-samples/Samples/1_Utilities/deviceQuery && \
make
CMD ["/code/cuda-samples/Samples/1_Utilities/deviceQuery/deviceQuery"]
NOTE: make sure to update the NVIDIA image in the future.
This Dockerfile builds an example from NVIDIA itself, called deviceQuery
, which prints very useful information for your specific hardware.
After building this image, run it with the --gpus all
tag and you should see information about your GPU.
Alternatively run
nvidia-smi --query-gpu=compute_cap --format=csv,noheader | head -n 1
From here to get only capability :/