4 Jan 2024 |
| thetootler joined the room. | 06:25:27 |
benoitdr | Strange ... It doesn't work without it on my side | 19:56:48 |
5 Jan 2024 |
| palo joined the room. | 08:38:35 |
| palo joined the room. | 08:54:18 |
| AVA 📞 3017 joined the room. | 10:16:35 |
| AVA 📞 3017 left the room. | 10:16:48 |
| Hmpffff joined the room. | 13:17:55 |
SomeoneSerge (UTC+3) | In reply to @benoitdr:matrix.org Strange ... It doesn't work without it on my side Could you elaborate? What are the errors | 17:31:24 |
6 Jan 2024 |
benoitdr | Here is my shell.nix file :
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/04220ed6763637e5899980f98d5c8424b1079353.tar.gz";
pkgs = import nixpkgs { config = { allowUnfree = true; }; overlays = []; };
ctransformers = pkgs.python310.pkgs.buildPythonPackage rec {
pname = "ctransformers";
version = "0.2.27";
format = "setuptools";
src = pkgs.python310.pkgs.fetchPypi {
inherit pname version;
sha256 = "25653d4be8a5ed4e2d3756544c1e9881bf95404be5371c3ed506a256c28663d5";
};
doCheck = false;
dontUseCmakeConfigure = true;
nativeBuildInputs = with pkgs; [
python310Packages.setuptools
python310Packages.scikit-build
python310Packages.ninja
python310Packages.cmake
];
propagatedBuildInputs = with pkgs; [
python310Packages.huggingface-hub
python310Packages.py-cpuinfo
cudaPackages.cudatoolkit
];
env.CT_CUBLAS = "ON";
};
in
pkgs.mkShell {
packages = with pkgs; [
(python310.withPackages (ps: with ps; [
ctransformers
]))
];
}
Without cudatoolkit, at compile time, ctransformers complaints that cublas is not found, and at runtime, ctransformers cannot use the GPU. As far as I undertstand, it seems a bit logical to me. How would ctransfomers find the cuda libraries without cudatoolkit ?
| 10:29:05 |
benoitdr | BTW, the same thing happens if I set cudaSupport to true like this :
pkgs = import nixpkgs { config = { allowUnfree = true; cudaSupport = true; }; overlays = []; };
cudatoolkit is still needed
| 10:43:54 |
SomeoneSerge (UTC+3) | In reply to @benoitdr:matrix.org
Here is my shell.nix file :
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/04220ed6763637e5899980f98d5c8424b1079353.tar.gz";
pkgs = import nixpkgs { config = { allowUnfree = true; }; overlays = []; };
ctransformers = pkgs.python310.pkgs.buildPythonPackage rec {
pname = "ctransformers";
version = "0.2.27";
format = "setuptools";
src = pkgs.python310.pkgs.fetchPypi {
inherit pname version;
sha256 = "25653d4be8a5ed4e2d3756544c1e9881bf95404be5371c3ed506a256c28663d5";
};
doCheck = false;
dontUseCmakeConfigure = true;
nativeBuildInputs = with pkgs; [
python310Packages.setuptools
python310Packages.scikit-build
python310Packages.ninja
python310Packages.cmake
];
propagatedBuildInputs = with pkgs; [
python310Packages.huggingface-hub
python310Packages.py-cpuinfo
cudaPackages.cudatoolkit
];
env.CT_CUBLAS = "ON";
};
in
pkgs.mkShell {
packages = with pkgs; [
(python310.withPackages (ps: with ps; [
ctransformers
]))
];
}
Without cudatoolkit, at compile time, ctransformers complaints that cublas is not found, and at runtime, ctransformers cannot use the GPU. As far as I undertstand, it seems a bit logical to me. How would ctransfomers find the cuda libraries without cudatoolkit ?
By you llisting individual cuda libraries and nvcc as inputs, cf torch/default.nix and opencv/4.nix for the examples
The documentation needs to be clarified about this... | 14:40:09 |
7 Jan 2024 |
benoitdr | Indeed a bit of documentation would help ;-) Looking at cudatoolkit sources, I can see that it's importing many many things I don't need, so I would be happy to get rid of it. Unfortunately, if I replace it by cuda_nvcc, cuda_cudart and libcublas, ctransformers doesn't build anymore.
-- Using CUDA architectures: 52;61;70
-- Unable to find cuda_runtime.h in "/nix/store/p8058x6fpdlw7hy72qsqn41qhllqncgm-cuda_nvcc-11.8.89/include" for CUDAToolkit_INCLUDE_DIR.
-- Unable to find cublas_v2.h in either "" or "/nix/math_libs/include"
-- Could NOT find CUDAToolkit (missing: CUDAToolkit_INCLUDE_DIR) (found version "11.8.89")
CMake Warning at CMakeLists.txt:163 (message):
cuBLAS not found
Looking at CMakeLists.txt :
if (CT_CUBLAS)
find_package(CUDAToolkit)
So it seems there is a problem with the CUDAToolkit_INCLUDE_DIR env variable. Not sure it's related, but looking at https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html, that function is setting a CUDAToolkit_INCLUDE_DIRS (with extra S)
| 10:27:28 |
SomeoneSerge (UTC+3) | Is cuda_nvcc in nativeBuildInputs? | 10:29:56 |
benoitdr | yes | 10:34:09 |
SomeoneSerge (UTC+3) | In reply to @benoitdr:matrix.org
Indeed a bit of documentation would help ;-) Looking at cudatoolkit sources, I can see that it's importing many many things I don't need, so I would be happy to get rid of it. Unfortunately, if I replace it by cuda_nvcc, cuda_cudart and libcublas, ctransformers doesn't build anymore.
-- Using CUDA architectures: 52;61;70
-- Unable to find cuda_runtime.h in "/nix/store/p8058x6fpdlw7hy72qsqn41qhllqncgm-cuda_nvcc-11.8.89/include" for CUDAToolkit_INCLUDE_DIR.
-- Unable to find cublas_v2.h in either "" or "/nix/math_libs/include"
-- Could NOT find CUDAToolkit (missing: CUDAToolkit_INCLUDE_DIR) (found version "11.8.89")
CMake Warning at CMakeLists.txt:163 (message):
cuBLAS not found
Looking at CMakeLists.txt :
if (CT_CUBLAS)
find_package(CUDAToolkit)
So it seems there is a problem with the CUDAToolkit_INCLUDE_DIR env variable. Not sure it's related, but looking at https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html, that function is setting a CUDAToolkit_INCLUDE_DIRS (with extra S)
Ah, this is because they wrap cmake into the setup.py | 12:58:41 |
SomeoneSerge (UTC+3) | Got to pass the cmakeFlags to cmake | 12:59:09 |
SomeoneSerge (UTC+3) | In reply to @benoitdr:matrix.org
Indeed a bit of documentation would help ;-) Looking at cudatoolkit sources, I can see that it's importing many many things I don't need, so I would be happy to get rid of it. Unfortunately, if I replace it by cuda_nvcc, cuda_cudart and libcublas, ctransformers doesn't build anymore.
-- Using CUDA architectures: 52;61;70
-- Unable to find cuda_runtime.h in "/nix/store/p8058x6fpdlw7hy72qsqn41qhllqncgm-cuda_nvcc-11.8.89/include" for CUDAToolkit_INCLUDE_DIR.
-- Unable to find cublas_v2.h in either "" or "/nix/math_libs/include"
-- Could NOT find CUDAToolkit (missing: CUDAToolkit_INCLUDE_DIR) (found version "11.8.89")
CMake Warning at CMakeLists.txt:163 (message):
cuBLAS not found
Looking at CMakeLists.txt :
if (CT_CUBLAS)
find_package(CUDAToolkit)
So it seems there is a problem with the CUDAToolkit_INCLUDE_DIR env variable. Not sure it's related, but looking at https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html, that function is setting a CUDAToolkit_INCLUDE_DIRS (with extra S)
https://gist.github.com/SomeoneSerge/3c2fc29c79dfc4803c5cb277688566a7 | 13:10:20 |
8 Jan 2024 |
| SomeoneSerge (UTC+3) changed their display name from SomeoneSerge (UTC+2) to SomeoneSerge (hash-versioned python modules when). | 04:50:11 |
benoitdr | OK I see, thanks for the explanations and the example | 09:45:12 |
13 Jan 2024 |
| gambrose joined the room. | 00:41:46 |
gambrose | Hi all. New here and am looking for some help. I am trying to get a persistent jupyterhub/lab up and running on nixos. I have made progress, but stuck on two items. First, is it possible in the approach I am using to add jupyterlab extensions declaratively? I saw that its possible if I build a shell to use, but I would rather not take that approach. Second, while I got a pything env up and running with some basic data science packages to try out, I can't get an R to work. Console won't connect to the kernel, even after multiple attempts. Pasting my code below, if anyone has pointers who may have tried this. Thanks!
| 04:58:28 |
gambrose | { config, lib, pkgs, ... }:
{
services.jupyterhub = {
enable = true;
jupyterhubEnv = pkgs.python311.withPackages (p: with p; [
jupyterhub
jupyterhub-systemdspawner
pip
ipython
jupyter
notebook
ipykernel
]);
jupyterlabEnv = pkgs.python311.withPackages (p: with p; [
jupyterhub
jupyterlab
pip
ipython
jupyter
notebook
ipykernel
]);
kernels = {
python311 = let
env = (pkgs.python311.withPackages (python311Packages: with python311Packages; [
ipykernel
pandas
scikit-learn
numpy
seaborn
matplotlib
scipy
]));
in {
displayName = "Python 3 for ML";
argv = [
"${env.interpreter}"
"-m"
"ipykernel_launcher"
"-f"
"{connection_file}"
];
language = "python";
logo32 = "${env.sitePackages}/ipykernel/resources/logo-32x32.png";
logo64 = "${env.sitePackages}/ipykernel/resources/logo-64x64.png";
};
R = let
env = (pkgs.rWrapper.override {
packages = with pkgs.rPackages; [
IRkernel
tidyverse
caret
randomForest
tidymodels
purrr
shiny
data_table
jsonlite
];
});
in {
displayName = "R for ML";
argv = [
"/nix/store/pqynpqccbr41zz3pg844qiq2h87mxhwx-R-4.3.2-wrapper/bin/R"
"--slave"
"-e"
"IRkernel::main()"
"--args"
"{connection_file}"
];
language = "R";
logo32 = "${env.sitePackages}/IRKernel/resources/logo-32x32.png";
logo64 = "${env.sitePackages}/IRkernel/resources/logo-64x64.png";
};
};
};
}
| 04:58:33 |
gambrose | * Hi all. New here and am looking for some help. I am trying to get a persistent jupyterhub/lab up and running on nixos. I have made progress, but stuck on two items. First, is it possible in the approach I am using to add jupyterlab extensions declaratively? I saw that its possible if I build a shell to use, but I would rather not take that approach. Second, while I got a python env up and running with some basic data science packages to try out, but I can't get an R to work. Console won't connect to the kernel, even after multiple attempts, including finding and using the full path to the R bin. Pasting my code below, if anyone has pointers who may have tried this. Thanks!
| 05:00:17 |
| felipeggmarcelino joined the room. | 19:53:14 |
14 Jan 2024 |
benoitdr | In reply to @gambrose:matrix.org Hi all. New here and am looking for some help. I am trying to get a persistent jupyterhub/lab up and running on nixos. I have made progress, but stuck on two items. First, is it possible in the approach I am using to add jupyterlab extensions declaratively? I saw that its possible if I build a shell to use, but I would rather not take that approach. Second, while I got a python env up and running with some basic data science packages to try out, but I can't get an R to work. Console won't connect to the kernel, even after multiple attempts, including finding and using the full path to the R bin. Pasting my code below, if anyone has pointers who may have tried this. Thanks!
For the extensions, can't you just add them like other packages ? See jupyterlab-widgets, jupyterlab-git, jupyterlab-lsp, ... | 09:29:23 |
15 Jan 2024 |
gambrose | In reply to @benoitdr:matrix.org For the extensions, can't you just add them like other packages ? See jupyterlab-widgets, jupyterlab-git, jupyterlab-lsp, ... Yes, that works for some extensions that have official packages (like jupyterlab-lsp), but not all extensions have packages, but I can probably do a derivation to create them from their github repos. But related issue. Jupyterlab-git needs regular git installed, which it obvioulsy is on the base system, but the jupyterhub/lab environment for some reason can't see git. I must need to load it into the hub/lab environment. They are built like this: | 02:49:40 |
gambrose | In reply to @benoitdr:matrix.org For the extensions, can't you just add them like other packages ? See jupyterlab-widgets, jupyterlab-git, jupyterlab-lsp, ... * Yes, that works for some extensions that have official packages (like jupyterlab-lsp), but not all extensions have packages, but I can probably do a derivation to create them from their github repos. But related issue. Jupyterlab-git needs regular git installed, which it obvioulsy is on the base system, but the jupyterhub/lab environment for some reason can't see git. I must need to load it into the hub/lab environment. They are built with this:
jupyterhubEnv = pkgs.python311.withPackages (p: with p; [
jupyterhub
jupyterhub-systemdspawner
...
| 02:50:18 |
gambrose | * Yes, that works for some extensions that have official packages (like jupyterlab-lsp), but not all extensions have packages, but I can probably do a derivation to create them from their github repos. But related issue. Jupyterlab-git needs regular git installed, which it obvioulsy is on the base system, but the jupyterhub/lab environment for some reason can't see git. I must need to load it into the hub/lab environment. They are built with this:
jupyterhubEnv = pkgs.python311.withPackages (p: with p; [
jupyterhub
jupyterhub-systemdspawner
...
Is it possible to load non python311pacakges into this enviornment. I tried a few different ways, but couldn't get it to work. Trying to load the regular git nixos package. Thanks!
| 02:52:00 |
gambrose | * Yes, that works for some extensions that have official packages (like jupyterlab-lsp), but not all extensions have packages, but I can probably do a derivation to create them from their github repos. But related issue. Jupyterlab-git needs regular git installed, which it obvioulsy is on the base system, but the jupyterhub/lab environment for some reason can't see git. I must need to load it into the hub/lab environment. They are built like this: | 03:26:01 |
gambrose | * Yes, that works for some extensions that have official packages (like jupyterlab-lsp), but not all extensions have packages, but I can probably do a derivation to create them from their github repos. But related issue. Jupyterlab-git needs regular git installed, which it obvioulsy is on the base system, but the jupyterhub/lab environment for some reason can't see git. I must need to load it into the hub/lab environment. They are built like this:
jupyterhubEnv = pkgs.python311.withPackages (p: with p; [
jupyterhub
jupyterhub-systemdspawner
pip
...
It appears you can only load python packages into the underlying environment. Is there a way to load non python packages, such as git? Thanks.
| 03:28:00 |