NVIDIA in nix-shell not working

For the life of me I can’t figure out how to get CUDA stuff working within a nix-shell. Any help would be greatly appreciated! I have a Ubuntu 20.04 machine with a GTX 1060 gpu:

❯ nvidia-smi                                       
Sat Aug  8 23:15:19 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+

However, I just can’t get nvidia-smi working from within a nix-shell. Following the directions in the docs here (Nvidia - NixOS Wiki), I set up the following nvidiabug.nix:

{ pkgs ? import <nixpkgs> {} }:

let
  libs = [
    pkgs.linuxPackages.nvidia_x11
  ];
in pkgs.mkShell {
  buildInputs = [
    pkgs.cudatoolkit
    pkgs.linuxPackages.nvidia_x11
  ];

  LD_LIBRARY_PATH = "${pkgs.stdenv.lib.makeLibraryPath libs}";
}

However, when I attempt to run nvidia-smi from within this via nix-shell it doesn’t work:

❯ nix-shell nvidiabug.nix --run "nvidia-smi"     
Failed to initialize NVML: Driver/library version mismatch

I suspect that the fact nvidia-smi is from my ubuntu install may be part of the issue:

❯ nix-shell nvidiabug.nix --run "which nvidia-smi"
/usr/bin/nvidia-smi

However, I haven’t been able to find any nix package that offers the nvidia-smi binary:

❯ nix-locate 'nvidia-smi'                         

Is it possible to use CUDA from within Nix/a nix-shell? Has anyone gotten this to work before?

This is how I do it:

I notice that in that example there are pinned CUDA versions (cudatoolkit_10_1). Does this relate somehow to the installed driver version you have? Why not just use cudatoolkit?

1 Like

For many applications, cuda is not backwards compatible. Tensorflow 2.2, for example, requires Cuda 10.1

Gotcha, I’m trying to run taichi (GitHub - taichi-dev/taichi: Productive & portable high-performance programming in Python.), so I’ll have to poke around and see what CUDA versions they support.

Just for learning purposes, how could I get the nvidia-smi example working? I’m not even sure how to find a package that includes the nvidia-smi binary.

Ha, that’s funny. I was just playing around with difftaichi/taichi elements for a project I’m working on. I think 10.1 is supported fine (that’s what I’m using). nvidia-smi should be installed by the nvidia-drivers; is there a reason you need to run it from within nix-shell?

Oh, wow small world! I’ll send over the shell.nix that I have that almost works and maybe we can figure it out together then!

I don’t actually need to run it via nix-shell. I just figured that Taichi prob wouldn’t work until I got nvidia-smi working.

For what it’s worth, I have nvidia-smi inside and outside of nix-shell so long as I don’t evaluate the shell.nix with the --pure flag. If you want it in a pure environment, you can also forward the external path (thus breaking purity)

with import <nixpkgs> {};
mkShell {
  name = "cuda-test";

  nativeBuildInputs = [
    cudatoolkit_10_1
  ];

  shellHook = ''
    export PATH=$PATH:/run/current-system/sw/bin
    export LD_LIBRARY_PATH=${pkgs.libGL}/lib:${pkgs.libGLU}/lib:${pkgs.freeglut}/lib:${pkgs.xorg.libX11}/lib:${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.cudatoolkit_10_1}/lib:${pkgs.cudnn_cudatoolkit_10_1}/lib:${pkgs.cudatoolkit_10_1.lib}/lib:$LD_LIBRARY_PATH
  '';
}

System drivers aren’t typically packaged into shell derivation (and to be honest, I’m not sure how that would work), which is what provides the nvidia-smi command.

1 Like

Interesting… where is cudatoolkit_10_1 coming from? I’m not able to find that attribute name on the nixpkgs search in either 20.03 or unstable.

I’m on nixpkgs unstable, it should be in pkgs. Do you have unfree and cuda enabled in your nixpkgs config?

❯ nix search cudatoolkit_10_1
warning: using cached results; pass '-u' to update the cache
* nixpkgs.cudaPackages.cudatoolkit_10_1 (cudatoolkit-10.1.243)
  A compiler for NVIDIA GPUs, math libraries, and tools

* nixpkgs.cudatoolkit_10_1 (cudatoolkit-10.1.243)
  A compiler for NVIDIA GPUs, math libraries, and tools

* nixpkgs.cudnn_cudatoolkit_10_1 (cudatoolkit-10.1-cudnn-7.6.3)
  NVIDIA CUDA Deep Neural Network library (cuDNN)

❯ nix repl
Welcome to Nix version 2.3.7. Type :? for help.

nix-repl> :l <nixpkgs>
Added 12152 variables.

nix-repl> pkgs.cudatoolkit_10_1
«derivation /nix/store/233nfzcl7fc57j8bgmhhdiizkvypja3m-cudatoolkit-10.1.243.drv»

Here’s my shell.nix:

{ pkgs ? import <nixpkgs> {} }:

let
  venvDir = "./.venv-nix";

  # These are necessary for taichi at runtime.
  libs = [
    pkgs.stdenv.cc.cc.lib
    pkgs.xorg.libX11
    pkgs.ncurses5
    pkgs.linuxPackages.nvidia_x11
  ];
in pkgs.mkShell {
  buildInputs = [
    pkgs.python3
    # pkgs.cudatoolkit
  ];

  nativeBuildInputs = [ pkgs.cudatoolkit_10_1 ];

  shellHook = ''
    if [ -d "${venvDir}" ]; then
      echo "Virtualenv '${venvDir}' already exists"
    else
      echo "Creating virtualenv '${venvDir}'"
      ${pkgs.python3Packages.python.interpreter} -m venv "${venvDir}"
    fi
    source "${venvDir}/bin/activate"
    pip install -r ./requirements.txt
  '';

  LD_LIBRARY_PATH = "${pkgs.stdenv.lib.makeLibraryPath libs}";
  CUDA_PATH = "${pkgs.cudatoolkit}";
}

This is in a clone of GitHub - taichi-dev/difftaichi: 10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020), so requirements.txt looks like:

taichi>=0.6.16
matplotlib
numpy
opencv-python
scipy

But then:

❯ nix-shell shell.nix --run "python3 -c 'import taichi as ti; ti.init(arch=ti.cuda)'"
Virtualenv './.venv-nix' already exists
...
[Taichi] mode=release
[Taichi] version 0.6.24, llvm 10.0.0, commit 0dc7ed79, python 3.8.5
[Taichi] loading test module
[Taichi] Starting on arch=cuda
[E 08/09/20 15:52:25.058] [cuda_driver.h:operator()@71] CUDA Error CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW while calling init (cuInit)


***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDADriverFunction<int>::operator()(int)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDAContext::CUDAContext()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDAContext::get_instance()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::RuntimeCUDA::detected()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::Program::Program(taichi::lang::Arch)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x6e25c9) [0x7fb1dd0b95c9]
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x5b16b0) [0x7fb1dcf886b0]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyCFunction_Call
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyObject_MakeTpCall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x7bf4e) [0x7fb1e0d0df4e]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyVectorcall_Call
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x167ce6) [0x7fb1e0df9ce6]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x16572d) [0x7fb1e0df772d]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyObject_MakeTpCall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyFunction_Vectorcall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalCodeWithName
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyFunction_Vectorcall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalCodeWithName
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyEval_EvalCodeEx
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyEval_EvalCode
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x21bdc8) [0x7fb1e0eaddc8]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x21bd63) [0x7fb1e0eadd63]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyRun_StringFlags
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyRun_SimpleStringFlags
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: Py_RunMain
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: Py_BytesMain
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6: __libc_start_main
python3(_start+0x2a) [0x40107a]

Internal Error occurred, check this page for possible solutions:
https://taichi.readthedocs.io/en/stable/install.html#troubleshooting
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/lang/__init__.py", line 209, in init
    ti.get_runtime().create_program()
  File "/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/lang/impl.py", line 200, in create_program
    self.prog = taichi_lang_core.Program()
RuntimeError: [cuda_driver.h:operator()@71] CUDA Error CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW while calling init (cuInit)

:frowning:

I did some modifications in your shell.nix and it worked for me:

{ pkgs ? import <nixpkgs> { } }:
let
  venvDir = "./.venv-nix";

  # These are necessary for taichi at runtime.
  libs = [
    pkgs.stdenv.cc.cc.lib
    pkgs.xorg.libX11
    pkgs.ncurses5
    pkgs.linuxPackages.nvidia_x11
    pkgs.libGL
    pkgs.libzip
    pkgs.glib
  ];
in
pkgs.mkShell {
  buildInputs = [
    pkgs.python3
    # pkgs.cudatoolkit
  ];

  nativeBuildInputs = [ pkgs.cudatoolkit_10_1 ];

  shellHook = ''
    if [ -d "${venvDir}" ]; then
      echo "Virtualenv '${venvDir}' already exists"
    else
      echo "Creating virtualenv '${venvDir}'"
      ${pkgs.python3Packages.python.interpreter} -m venv "${venvDir}"
    fi
    source "${venvDir}/bin/activate"
    pip install -r ./requirements.txt
  '';

  LD_LIBRARY_PATH = "${pkgs.stdenv.lib.makeLibraryPath libs}";
  CUDA_PATH = "${ pkgs.cudatoolkit_10_1 }";
}

❯ nix-shell shell.nix --run "python3 -c 'import taichi as ti; ti.init(arch=ti.cuda)'"
Virtualenv './.venv-nix' already exists
Requirement already satisfied: taichi>=0.6.16 in ./.venv-nix/lib/python3.8/site-packages (from -r ./requirements.txt (line 1)) (0.6.24)
Requirement already satisfied: matplotlib in ./.venv-nix/lib/python3.8/site-packages (from -r ./requirements.txt (line 2)) (3.3.0)
Requirement already satisfied: numpy in ./.venv-nix/lib/python3.8/site-packages (from -r ./requirements.txt (line 3)) (1.19.1)
Requirement already satisfied: opencv-python in ./.venv-nix/lib/python3.8/site-packages (from -r ./requirements.txt (line 4)) (4.3.0.38)
Requirement already satisfied: scipy in ./.venv-nix/lib/python3.8/site-packages (from -r ./requirements.txt (line 5)) (1.5.2)
Requirement already satisfied: astor in ./.venv-nix/lib/python3.8/site-packages (from taichi>=0.6.16->-r ./requirements.txt (line 1)) (0.8.1)
Requirement already satisfied: pybind11>=2.5.0 in ./.venv-nix/lib/python3.8/site-packages (from taichi>=0.6.16->-r ./requirements.txt (line 1)) (2.5.0)
Requirement already satisfied: setuptools in ./.venv-nix/lib/python3.8/site-packages (from taichi>=0.6.16->-r ./requirements.txt (line 1)) (47.1.0)
Requirement already satisfied: colorama in ./.venv-nix/lib/python3.8/site-packages (from taichi>=0.6.16->-r ./requirements.txt (line 1)) (0.4.3)
Requirement already satisfied: python-dateutil>=2.1 in ./.venv-nix/lib/python3.8/site-packages (from matplotlib->-r ./requirements.txt (line 2)) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in ./.venv-nix/lib/python3.8/site-packages (from matplotlib->-r ./requirements.txt (line 2)) (1.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in ./.venv-nix/lib/python3.8/site-packages (from matplotlib->-r ./requirements.txt (line 2)) (2.4.7)
Requirement already satisfied: pillow>=6.2.0 in ./.venv-nix/lib/python3.8/site-packages (from matplotlib->-r ./requirements.txt (line 2)) (7.2.0)
Requirement already satisfied: cycler>=0.10 in ./.venv-nix/lib/python3.8/site-packages (from matplotlib->-r ./requirements.txt (line 2)) (0.10.0)
Requirement already satisfied: six>=1.5 in ./.venv-nix/lib/python3.8/site-packages (from python-dateutil>=2.1->matplotlib->-r ./requirements.txt (line 2)) (1.15.0)
WARNING: You are using pip version 20.1.1; however, version 20.2.1 is available.
You should consider upgrading via the '/home/thiago/Testing/difftaichi/.venv-nix/bin/python3.8 -m pip install --upgrade pip' command.
[Taichi] mode=release
[Taichi] version 0.6.24, llvm 10.0.0, commit 0dc7ed79, python 3.8.5
[Taichi] loading test module
[Taichi] Starting on arch=cuda

Thanks @brogos! I just tried running with your shell.nix, but I’m still getting the same error. I also tried cudatoolkit_10_2 instead of 10.1 since nvidia-smi says my system is on 10.2, but still no luck:

[Taichi] Starting on arch=cuda
[E 08/10/20 12:57:31.386] [cuda_driver.h:operator()@71] CUDA Error CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW while calling init (cuInit)


***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDADriverFunction<int>::operator()(int)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDAContext::CUDAContext()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::CUDAContext::get_instance()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::RuntimeCUDA::detected()
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::Program::Program(taichi::lang::Arch)
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x6e25c9) [0x7fab6da745c9]
/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x5b16b0) [0x7fab6d9436b0]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyCFunction_Call
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyObject_MakeTpCall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x7bf4e) [0x7fab716cbf4e]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyVectorcall_Call
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x167ce6) [0x7fab717b7ce6]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x16572d) [0x7fab717b572d]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyObject_MakeTpCall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyFunction_Vectorcall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalCodeWithName
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyFunction_Vectorcall
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalFrameDefault
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: _PyEval_EvalCodeWithName
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyEval_EvalCodeEx
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyEval_EvalCode
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x21bdc8) [0x7fab7186bdc8]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0(+0x21bd63) [0x7fab7186bd63]
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyRun_StringFlags
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: PyRun_SimpleStringFlags
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: Py_RunMain
/nix/store/cfnpsvmkdldbd07gsf9ar2gl49qbmhim-python3-3.8.5/lib/libpython3.8.so.1.0: Py_BytesMain
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6: __libc_start_main
python3(_start+0x2a) [0x40107a]

Internal Error occurred, check this page for possible solutions:
https://taichi.readthedocs.io/en/stable/install.html#troubleshooting
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/lang/__init__.py", line 209, in init
    ti.get_runtime().create_program()
  File "/home/skainswo/dev/difftaichi/.venv-nix/lib/python3.8/site-packages/taichi/lang/impl.py", line 200, in create_program
    self.prog = taichi_lang_core.Program()
RuntimeError: [cuda_driver.h:operator()@71] CUDA Error CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW while calling init (cuInit)

Nvidia-smi does not accurately reflect your cuda version, I wouldn’t use that as a litmus

Ah I didn’t know that. I may not even have CUDA installed:

❯ nvcc --version
zsh: command not found: nvcc

Is this problematic? Taichi has no issue working outside of nix…

I’m actually a little bit confused how it’s not working for me, but the exact same shell.nix is working on @brogos system. Isn’t nix supposed to guarantee reproducibility and all that good stuff?

Using import <nixpkgs> {} is impure and breaks reproducibility.

Have you checked if both of you are on the same channel and the same commit of it?

I’m in nixos-unstable last version (20.09pre237686.96069f7d890 (Nightingale))

How do I see what version my channels are on? My googling has failed me…

I used nixos-version