8 Jul 2024 |
Someone (UTC+3) | If you build cudaPackages.cudatoolkit you'll see that it's actually a symlink farm which includes a lot of stuff you don't need. In particular:
❯ readlink -f result/nvvm/lib64/libnvvm.so.4.0.0
/nix/store/fby2d6b4jgfb8awwjhzdrd13r8vx7ilw-cuda_nvcc-12.2.140-bin/nvvm/lib64/libnvvm.so.4.0.0
...it would've been enough for you to use ${getBin cudaPackages.cuda_nvcc}/nvvm/lib64/libnvvm.so which is much smaller (whoops, that's a bug, we definitely didn't want this to end up in .bin , so expect this to change) | 16:12:09 |
9 Jul 2024 |
| ghishadow joined the room. | 04:20:35 |
jeroenvb3 | I would think runtime for jit, since there is a @cuda.jit operator on my python code. This is now my shell.nix, removed extra buildInputs, and used the wrapper, which had to be python39 to even get back to where I was:
config = {
allowUnfree = true;
cudaSupport = true;
};
};
let
pythonEnv = pkgs.python39.withPackages(ps: with ps; [ numba numpy ]);
in
pkgs.mkShell {
name = "cuda-env-shell";
buildInputs = [
pythonEnv
libstdcxx5
cudaPackages.cudatoolkit
];
shellHook = ''
export CUDA_PATH=${pkgs.cudaPackages.cudatoolkit}
export CUDA_HOME=${pkgs.cudatoolkit}
export EXTRA_CCFLAGS="-I/usr/include"
export NUMBAPRO_NVVM=${pkgs.cudatoolkit}/nvvm/lib64/libnvvm.so
export NUMBAPRO_LIBDEVICE=${pkgs.cudatoolkit}/nvvm/libdevice
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/nvvm/lib64/libnvvm.so:$CUDA_HOME
# source venv/bin/activate
python test2.py
'';
}
If I go into python repl I can import numpy and numba, but I still get the same error when running an actual cuda script. This was the python code:
from numba import cuda
import numpy as np
@cuda.jit
def cudakernel0(array):
for i in range(array.size):
array[i] += 0.5
array = np.array([0, 1], np.float32)
print('Initial array:', array)
print('Kernel launch: cudakernel0[1, 1](array)')
cudakernel0[1, 1](array)
print('Updated array:',array)
I can run:
from numba import cuda
print(cuda.detect())
Also I doubt the linking of nvvm.so helps, since numba is now relying on the CUDA_HOME env var (https://numba.pydata.org/numba-doc/latest/cuda/overview.html). What do you mean to use ${getBin...}, where could I use that?
| 10:05:31 |
Someone (UTC+3) |
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/nvvm/lib64/libnvvm.so:$CUDA_HOME
I'm pretty sure gilbc treats LD_LIBRARY_PATH as a list of directories only (so you'd want LD_LIBRARY_PATH=${pkgs.cudatoolkit}/nvvm/lib64/ instead) | 10:42:21 |
Someone (UTC+3) |
Also I doubt the linking of nvvm.so helps, since numba is now relying on the CUDA_HOME env var
The error you posted earlier suggests that they just dlopen("libnvvm.so", ...) | 10:42:57 |
jeroenvb3 | In reply to @ss:someonex.net
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/nvvm/lib64/libnvvm.so:$CUDA_HOME
I'm pretty sure gilbc treats LD_LIBRARY_PATH as a list of directories only (so you'd want LD_LIBRARY_PATH=${pkgs.cudatoolkit}/nvvm/lib64/ instead) That was true yes, it seems it does find it now. However it claims:
No supported GPU compute capabilities found. Please check your cudatoolkit version matches your CUDA version
nvcc --version gives 12.2, and nvidia-smi gives 12.4. This should be compatible as far as I'm aware. I'll see if I can get more info on this, unless you know that this is not supposed to be compatible and I need to adjust one of the versions.
| 12:26:13 |
Someone (UTC+3) | In reply to @jeroenvb3:matrix.org
That was true yes, it seems it does find it now. However it claims:
No supported GPU compute capabilities found. Please check your cudatoolkit version matches your CUDA version
nvcc --version gives 12.2, and nvidia-smi gives 12.4. This should be compatible as far as I'm aware. I'll see if I can get more info on this, unless you know that this is not supposed to be compatible and I need to adjust one of the versions.
Could you gist a reproducing code and a full log? | 12:30:02 |
10 Jul 2024 |
jeroenvb3 | In reply to @ss:someonex.net Could you gist a reproducing code and a full log? https://gitlab.com/jeroenvb3/cuda-setup
I added the nix config, the python code, the output, and my nvidia driver info. If you need more system info please tell but I'd think this is all that will be unique. Thanks!
| 10:23:54 |
12 Jul 2024 |
| valconius left the room. | 01:16:43 |
15 Jul 2024 |
| @hasnep:matrix.org joined the room. | 01:58:17 |
| @dminca:matrix.org changed their display name from dminca to nixpkgs. | 17:28:58 |
| @dminca:matrix.org changed their display name from nixpkgs to dminca. | 17:42:37 |
18 Jul 2024 |
| tewi 🏳️⚧️ joined the room. | 00:23:50 |
| tewi 🏳️⚧️ changed their profile picture. | 23:50:51 |
| tewi 🏳️⚧️ removed their profile picture. | 23:52:42 |
| tewi 🏳️⚧️ set a profile picture. | 23:53:18 |
22 Jul 2024 |
| Luke joined the room. | 22:20:25 |
23 Jul 2024 |
| Ezzobir Bezziou joined the room. | 08:19:39 |
24 Jul 2024 |
| redstone-menace changed their display name from redstone-menace to Redstone. | 10:16:13 |
| lambadada left the room. | 23:57:16 |
29 Jul 2024 |
| Jeff joined the room. | 19:29:43 |
1 Aug 2024 |
Bruno Rodrigues | hello , we could use some testers on NixOS that have an nvidia GPU
would really appreciate if you could review this PR: https://github.com/NixOS/nixpkgs/pull/328980
especially following the instructions in the documentation: https://github.com/NixOS/nixpkgs/blob/7c2dcd41c35833809f05108c75ca0a6e3df242ce/doc/languages-frameworks/r.section.md#torch-with-gpu-acceleration-torch-gpu-accel
question is, do we need nixglhost even on NixOs ? some first testing seems to indicate that yes | 19:16:35 |
Bruno Rodrigues | or if you have a Mac you could help get and test the right binary for Darwin | 19:20:41 |
3 Aug 2024 |
Someone (UTC+3) | In reply to @brodriguesco:matrix.org
hello , we could use some testers on NixOS that have an nvidia GPU
would really appreciate if you could review this PR: https://github.com/NixOS/nixpkgs/pull/328980
especially following the instructions in the documentation: https://github.com/NixOS/nixpkgs/blob/7c2dcd41c35833809f05108c75ca0a6e3df242ce/doc/languages-frameworks/r.section.md#torch-with-gpu-acceleration-torch-gpu-accel
question is, do we need nixglhost even on NixOs ? some first testing seems to indicate that yes I'll try run some tests on sunday | 09:53:37 |
Someone (UTC+3) | * I'll try run some tests on sunday (not blocking) | 09:54:03 |
5 Aug 2024 |
| d92idk joined the room. | 14:00:57 |
8 Aug 2024 |
| trexd left the room. | 15:24:33 |
14 Aug 2024 |
| peddie changed their profile picture. | 00:34:43 |
16 Aug 2024 |
Bruno Rodrigues | folks, I have a draft PR for Positron: https://github.com/NixOS/nixpkgs/pull/335078
feedback more than welcome, especially from Python users! | 10:19:25 |
20 Aug 2024 |
| benjaminedwardwebb changed their display name from benjaminedwardwebb to benwebb. | 12:44:19 |