I am working on creating gateware and firmware using:

python -m artiq.gateware.targets.kasli indiana2.json

For background, the Vivado installer would not give me an option to download directly to the /opt folder in Ubuntu as Ubuntu did not appear as an option. To work around this, I installed onto the local disk itself, and subsequently copied the files to my home directory in Ubuntu. From here, I changed the appropriate paths in the main flake.nix file in addition to the settings64.sh file which solved my no 'directory or files' issue. However, when I run one final time to generate gateware and firmware, I receive an error with bwrap: 'Creating new namespace failed.'

Here is the error:

iontrap@oscillator:~/.config/nix/artiq$ python -m artiq.gateware.targets.kasli indiana2.json
SUServo (EEM0) starting at RTIO channel 0x000000
Zotino (EEM2) starting at RTIO channel 0x00000c
DIO (EEM5) starting at RTIO channel 0x00000f
USER LED at RTIO channel 0x000017
USER LED at RTIO channel 0x000018
USER LED at RTIO channel 0x000019
make: Entering directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software'
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/bootloader CPU=vexriscv
make[1]: Entering directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/bootloader'
CARGO cargo/riscv32ima-unknown-none-elf/debug/libbootloader.a
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
LD bootloader.elf
OBJCOPY bootloader.bin
MSCIMG bootloader.bin
make[1]: Leaving directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/bootloader'
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/libm CPU=vexriscv-g
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/libprintf CPU=vexriscv-g
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/libunwind CPU=vexriscv-g
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/ksupport CPU=vexriscv-g
make[1]: Entering directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/ksupport'
CARGO cargo/riscv32g-unknown-none-elf/debug/libksupport.a
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
LD ksupport.elf
make[1]: Leaving directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/ksupport'
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/libunwind CPU=vexriscv
make -C /home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/runtime CPU=vexriscv
make[1]: Entering directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/runtime'
CARGO cargo/riscv32ima-unknown-none-elf/debug/libruntime.a
Finished dev [unoptimized + debuginfo] target(s) in 0.19s
LD ksupport_data.o
LD runtime.elf
OBJCOPY runtime.bin
MSCIMG runtime.fbi
make[1]: Leaving directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software/runtime'
make: Leaving directory '/home/iontrap/.config/nix/artiq/artiq_kasli/indiana2/software'
bwrap: Creating new namespace failed: nesting depth or /proc/sys/user/max_*_namespaces exceeded (ENOSPC)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/iontrap/.config/nix/artiq/artiq/gateware/targets/kasli.py", line 858, in <module>
main()
File "/home/iontrap/.config/nix/artiq/artiq/gateware/targets/kasli.py", line 854, in main
build_artiq_soc(soc, builder_argdict(args))
File "/home/iontrap/.config/nix/artiq/artiq/build_soc.py", line 76, in build_artiq_soc
builder.build()
File "/nix/store/8bhwcl742ar0k88caawg9hqn13cx9y9g-python3-3.11.9-env/lib/python3.11/site-packages/misoc/integration/builder.py", line 201, in build
self.soc.build(build_dir=os.path.join(self.output_dir, "gateware"),
File "/nix/store/8bhwcl742ar0k88caawg9hqn13cx9y9g-python3-3.11.9-env/lib/python3.11/site-packages/misoc/integration/soc_core.py", line 222, in build
self.platform.build(self, *args, **kwargs)
File "/nix/store/8bhwcl742ar0k88caawg9hqn13cx9y9g-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/platform.py", line 59, in build
return self.toolchain.build(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/8bhwcl742ar0k88caawg9hqn13cx9y9g-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/vivado.py", line 224, in build
_run_vivado(build_name)
File "/nix/store/8bhwcl742ar0k88caawg9hqn13cx9y9g-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/vivado.py", line 69, in _run_vivado
raise OSError("Subprocess failed")
OSError: Subprocess failed

I did physically check the namespaces, but each one has a value of 15488. I am not sure how to resolve this issue. Any help is appreciated. Thanks.

    JBLYONS

    Have you also updated this part?

    Add /opt (or your Vivado location) as an Nix sandbox, for example by adding extra-sandbox-paths = /opt to nix.conf

    Since you're not using /opt, make sure to add the correct location to extra-sandbox-paths in your ~/.config/nix.conf.

    Reference:
    https://m-labs.hk/artiq/manual/building_developing.html#nix-development-environment

      fsagbuya Yes, I did. I also changed the source location to match my path as well, which is why I am struggling to figure out my issue. Any other suggestions are much appreciated!

      10 days later

      @JBLYONS
      Check if your Ubuntu version is compatible with Vivado 2022.2 . Should work with 18.04/1-18.04.6, 20.04, 20.04.1-20.04.4 or 22.04 LTS (with some extra libraries). We did it with Ubuntu 20.04.4 here, and we also installed Vivado in a different directory as you did.

      Also, as suggested above, adding extra-sandbox-paths = /your_vivado_path to your nix.conf should work. Make sure you are editing the right nix.conf and there are no duplicates. Depending on your install it could be at /etc/nix/nix.conf or /nix/.

        guscafe Check if your Ubuntu version is compatible with Vivado 2022.2 . Should work with 18.04/1-18.04.6, 20.04, 20.04.1-20.04.4 or 22.04 LTS (with some extra libraries). We did it with Ubuntu 20.04.4 here, and we also installed Vivado in a different directory as you did.

        Nix should provide the required libraries anyway, it should be distro-independent.

        11 days later

        Fix: I reinstalled everything from scratch. Specifically, I realized I was using Ubuntu 24 and moved to Ubuntu 22.04, and installed the Linux distribution of Vivado 2022.2, (I was accidentally working with the Windows distribution and I suspect this may have been the root of the namespace problem?). Furthermore, one final issue occurs in the installation sequence which involves creating and modifying a .wslconfig file such that I could hardcode a higher swap storage value.

        https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig

        With these edits, I was able to successfully generate gateware and firmware.